:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --ink: #182230;
  --muted: #667085;
  --line: #d0d5dd;
  --line-soft: #e4e7ec;
  --nav: #172033;
  --nav-soft: #25314a;
  --primary: #4e8f2f;
  --primary-dark: #35651e;
  --focus: #84adff;
  --danger: #c82d37;
  --warning: #b56b00;
  --draft: #e4e7ec;
  --provisional: #ffd966;
  --confirmed: #a9d18e;
  --cancelled: #ef747c;
  --completed: #b7c9e2;
  --resource-width: 210px;
  --day-width: 220px;
  --row-base-height: 184px;
  --shadow: 0 12px 34px rgba(16, 24, 40, .13);
  --radius: 10px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: #2358a8; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  min-height: 66px;
  padding: 10px 22px;
  background: var(--nav);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #78c850, #3d8f23);
  color: #fff; font-weight: 900; font-size: 13px; letter-spacing: .05em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.brand h1 { margin: 0; font-size: 18px; line-height: 1.15; }
.brand p { margin: 2px 0 0; color: #b7c3d8; font-size: 12px; }
.version-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; color: #fff; font-size: 10px; font-weight: 900; vertical-align: 1px; }
.top-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

.button, .icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 13px;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
.button:hover, .icon-button:hover { background: #f7f8fa; border-color: #98a2b3; }
.button:active, .icon-button:active { transform: translateY(1px); }
.button:focus-visible, .icon-button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(132, 173, 255, .45);
  outline-offset: 1px;
}
.button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button.danger.ghost { background: #fff; color: var(--danger); }
.button.ghost { background: #fff; }
.button.ghost.light { background: var(--nav-soft); color: #fff; border-color: rgba(255,255,255,.25); }
.button.ghost.light:hover { background: #34415d; }
.button.small { min-height: 32px; padding: 5px 9px; font-size: 12px; }
.icon-button {
  width: 38px; padding: 0; display: inline-grid; place-items: center; font-size: 22px; line-height: 1;
}
.close-button { font-size: 28px; color: var(--muted); }

main { padding-bottom: 26px; }
.toolbar {
  position: sticky;
  top: 66px;
  z-index: 60;
  min-height: 64px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.month-nav { display: flex; align-items: center; gap: 7px; }
.period-label { margin: 0; min-width: 200px; font-size: 20px; }
.compact-field { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.compact-field select {
  min-height: 37px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 30px 7px 9px; color: var(--ink);
}
.search-field { margin-left: auto; }
.search-field input {
  width: min(360px, 29vw); min-width: 240px; min-height: 38px;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
}

.filter-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 18px; background: #fbfcfd; border-bottom: 1px solid var(--line-soft); font-size: 12px;
}
.filter-label { color: var(--muted); font-weight: 800; margin-right: 2px; }
.status-filter {
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
  padding: 5px 9px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700;
}
.status-filter:not(.active) { opacity: .42; filter: grayscale(.75); }
.status-dot { width: 10px; height: 10px; border-radius: 3px; border: 1px solid rgba(0,0,0,.16); display: inline-block; }
.status-dot.draft { background: var(--draft); }
.status-dot.provisional { background: var(--provisional); }
.status-dot.confirmed { background: var(--confirmed); }
.status-dot.cancelled { background: var(--cancelled); }
.status-dot.completed { background: var(--completed); }
.filter-note { margin-left: auto; color: var(--muted); }

.onboarding {
  margin: 14px 14px 0;
  padding: 15px 17px;
  background: #fff9df;
  border: 1px solid #ebcf78;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.onboarding strong { display: block; margin-bottom: 3px; }
.onboarding p { margin: 0; color: #6a5316; font-size: 13px; }

.planner-card {
  position: relative;
  margin: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 5px 20px rgba(16, 24, 40, .07);
  overflow: hidden;
}
.planner-header-note {
  min-height: 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 9px 14px;
  background: #f8f9fb;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
}
.planner-scroll { overflow: auto; max-height: calc(100vh - 265px); min-height: 420px; }
.planner-grid {
  display: grid;
  min-width: max-content;
  position: relative;
}
.planner-corner {
  position: sticky; left: 0; top: 0; z-index: 35;
  width: var(--resource-width); min-width: var(--resource-width);
  padding: 14px;
  background: #e9edf3;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: .05em; font-size: 11px; font-weight: 900;
}
.date-header-cell {
  position: sticky; top: 0; z-index: 30;
  width: var(--day-width); min-width: var(--day-width); height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: #eef1f5;
  border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line);
}
.date-header-cell.weekend { background: #e6eaf0; }
.date-header-cell.today { background: #fff4ad; }
.date-header-cell.week-start { border-left: 2px solid #98a2b3; }
.date-header-cell .dow { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.date-header-cell .date-number { font-size: 17px; font-weight: 900; }
.date-header-cell .month-abbr { color: var(--muted); font-size: 10px; }
.resource-label {
  position: sticky; left: 0; z-index: 25;
  width: var(--resource-width); min-width: var(--resource-width);
  padding: 13px 12px;
  background: #fff;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 5px;
}
.resource-label strong { font-size: 14px; }
.resource-label small { color: var(--muted); font-size: 11px; }
.resource-swatch { width: 15px; height: 15px; border-radius: 4px; border: 1px solid rgba(0,0,0,.16); display: inline-block; vertical-align: -3px; margin-right: 6px; }
.resource-track {
  position: relative;
  display: grid;
  align-items: stretch;
  border-bottom: 1px solid var(--line-soft);
  min-height: var(--row-base-height);
  background-color: #fff;
}
.day-background {
  grid-row: 1 / -1;
  border-right: 1px solid var(--line-soft);
  min-height: 100%;
  background: #fff;
}
.day-background.weekend { background: #f6f7f9; }
.day-background.today { background: #fffbdd; }
.day-background.week-start { border-left: 2px solid #98a2b3; }
.day-background.drop-target { background: #e7f2ff; box-shadow: inset 0 0 0 2px #3b82f6; }
.day-background.course-create-cell {
  position: relative;
  cursor: pointer;
}
.day-background.course-create-cell::after {
  content: "+";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #35651e;
  font-size: 28px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
.day-background.course-create-cell:hover,
.day-background.course-create-cell:focus-visible {
  background: #eef8e9;
  box-shadow: inset 0 0 0 2px rgba(78, 143, 47, .6);
  outline: none;
}
.day-background.course-create-cell:hover::after,
.day-background.course-create-cell:focus-visible::after { opacity: .7; }

.course-card {
  position: relative;
  z-index: 10;
  min-width: 0;
  min-height: 168px;
  height: auto;
  margin: 7px 6px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.28);
  border-left: 7px solid var(--status-deep);
  background: var(--status-bg);
  color: #101828;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .16);
  text-align: left;
  overflow: visible;
  cursor: pointer;
  align-self: stretch;
}
.course-card:hover { box-shadow: 0 4px 10px rgba(16, 24, 40, .2); transform: translateY(-1px); }
.course-card:focus-visible { outline: 3px solid rgba(59, 130, 246, .45); outline-offset: 1px; }
.course-card.dragging { opacity: .45; }
.course-card.draft { --status-bg: var(--draft); --status-deep: #667085; }
.course-card.provisional { --status-bg: var(--provisional); --status-deep: #946200; }
.course-card.confirmed { --status-bg: var(--confirmed); --status-deep: #3a6f22; }
.course-card.cancelled { --status-bg: var(--cancelled); --status-deep: #9c1721; }
.course-card.completed { --status-bg: var(--completed); --status-deep: #3e5f89; }
.course-card.cancelled .course-card-title { text-decoration: line-through; }
.course-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}
.course-card-title {
  display: block;
  min-width: 0;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
}
.course-card-trainer {
  display: block;
  margin-top: 8px;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  color: rgba(0,0,0,.78);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.24;
}
.course-card-meta {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 6px;
  margin-top: 8px;
  min-width: 0;
  font-size: 12px;
}
.room-badge {
  --room: #d0d5dd;
  display: block;
  width: 100%;
  max-width: none;
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--room);
  border: 1px solid rgba(0,0,0,.2);
  color: #182230;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}
.course-location {
  display: block;
  color: rgba(0,0,0,.76);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}
.course-card-count {
  position: static;
  min-width: 42px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(0,0,0,.18);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.course-card-flags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  min-height: 18px;
}
.online-flag, .conflict-flag, .invoice-flag {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 900;
}
.invoice-flag {
  padding: 2px 7px;
  border: 1px solid rgba(49, 91, 37, .25);
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  color: #315b25;
}
.online-flag { color: #174a8b; }
.conflict-flag { color: #7a1b1b; }

.empty-state {
  min-height: 420px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); text-align: center; padding: 30px;
}
.empty-state strong { color: var(--ink); font-size: 17px; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(10, 18, 31, .64);
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(760px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal.medium { width: min(780px, calc(100vw - 36px)); }
.modal.wide { width: min(920px, calc(100vw - 36px)); }
.modal.extra-wide { width: min(1180px, calc(100vw - 36px)); }
.modal-header {
  padding: 18px 20px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-header h2 { margin: 2px 0 2px; font-size: 22px; }
.modal-header p { margin: 0; color: var(--muted); font-size: 13px; }
.eyebrow { color: #5b6b84; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-footer {
  min-height: 66px;
  padding: 12px 20px;
  border-top: 1px solid var(--line-soft);
  background: #fafbfc;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.footer-actions, .footer-left { display: flex; align-items: center; gap: 9px; }

.form-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { min-width: 0; }
.field.span-2, .form-error.span-2 { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 5px; color: #344054; font-size: 12px; font-weight: 800; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}
.field input, .field select { min-height: 39px; }
.field textarea { resize: vertical; }
.check-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd;
}
.check-grid label {
  display: flex; align-items: center; gap: 7px; margin: 0;
  padding: 6px 7px; border-radius: 6px; background: #fff; border: 1px solid var(--line-soft);
  font-weight: 700;
}
.check-grid input { width: auto; min-height: auto; }
.field .checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  cursor: pointer;
}
.checkbox-card input {
  width: 19px !important;
  height: 19px;
  min-height: 19px !important;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--primary);
}
.checkbox-card span { display: block; min-width: 0; }
.checkbox-card strong { display: block; color: #344054; font-size: 13px; }
.checkbox-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.empty-check-grid { display: block; color: var(--muted); font-size: 12px; }
.form-error { padding: 10px 12px; border-radius: 8px; background: #fff0f1; color: #9c1721; border: 1px solid #efb3b8; font-size: 13px; }

.detail-header { align-items: center; }
.detail-subtitle { display: flex; flex-wrap: wrap; gap: 7px 12px; align-items: center; color: var(--muted); font-size: 12px; margin-top: 5px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(0,0,0,.16);
  background: var(--chip); color: #182230; font-size: 11px; font-weight: 900;
}
.invoice-chip {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid #a7c99a; background: #eaf5e3; color: #315b25;
  font-size: 11px; font-weight: 900;
}
.invoice-chip.not-invoiced { border-color: var(--line); background: #f4f6f8; color: var(--muted); }
.invoice-text { color: #315b25; }
.tabs { display: flex; gap: 0; padding: 0 20px; border-bottom: 1px solid var(--line-soft); background: #fbfcfd; }
.tab-button, .settings-tab-button {
  border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 11px 14px; color: var(--muted); font-weight: 800;
}
.tab-button.active, .settings-tab-button.active { color: var(--ink); border-bottom-color: var(--primary); }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; border-radius: 999px; padding: 0 5px; background: #e4e7ec; font-size: 10px; }
.tab-panel, .settings-panel { display: none; }
.tab-panel.active, .settings-panel.active { display: block; }
.detail-body { min-height: 460px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.detail-card {
  min-width: 0; padding: 12px; border: 1px solid var(--line-soft); border-radius: 9px; background: #fff;
}
.detail-card.span-2 { grid-column: span 2; }
.detail-card.span-4 { grid-column: 1 / -1; }
.detail-card label, .detail-card .label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.detail-card strong { display: block; overflow-wrap: anywhere; }
.detail-card p { margin: 5px 0 0; white-space: pre-wrap; }
.summary-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.summary-card { padding: 13px; border-radius: 9px; background: #f4f6f8; border: 1px solid var(--line-soft); }
.summary-card strong { display: block; font-size: 23px; }
.summary-card span { color: var(--muted); font-size: 11px; }
.online-link { display: inline-flex; margin-top: 4px; font-weight: 800; }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.table-toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.table-wrap { overflow: auto; border: 1px solid var(--line-soft); border-radius: 9px; }
table { border-collapse: collapse; width: 100%; min-width: 860px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; font-size: 12px; }
th { position: sticky; top: 0; z-index: 3; background: #f4f6f8; color: #475467; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.table-primary { font-weight: 800; }
.table-secondary { margin-top: 2px; color: var(--muted); font-size: 11px; }
.inline-chip { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: #eef1f5; border: 1px solid var(--line-soft); font-size: 10px; font-weight: 800; }
.inline-chip.cancelled, .inline-chip.replaced { background: #fff0f1; color: #9c1721; }
.inline-chip.attended, .inline-chip.pass { background: #eaf5e3; color: #315b25; }
.inline-chip.pending, .inline-chip.provisional { background: #fff7d6; color: #735400; }
.actions-cell { white-space: nowrap; }
.empty-table { padding: 34px; text-align: center; color: var(--muted); }

.history-list { display: flex; flex-direction: column; gap: 9px; }
.history-item { padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 8px; background: #fff; }
.history-item strong { display: block; font-size: 13px; }
.history-item span { color: var(--muted); font-size: 11px; }
.history-item details { margin-top: 5px; font-size: 11px; color: var(--muted); }
.history-item pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 5px 0 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }

.settings-body { min-height: 480px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; }
.settings-list { border: 1px solid var(--line-soft); border-radius: 9px; overflow: hidden; }
.settings-list-header { padding: 10px 12px; background: #f4f6f8; border-bottom: 1px solid var(--line-soft); font-size: 11px; color: var(--muted); font-weight: 800; }
.settings-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.settings-row:last-child { border-bottom: 0; }
.settings-row.inactive { opacity: .54; }
.settings-row-main { min-width: 0; }
.settings-row-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-row-main span { color: var(--muted); font-size: 11px; }
.settings-form { padding: 14px; border: 1px solid var(--line-soft); border-radius: 9px; background: #fbfcfd; align-self: start; }
.settings-form h3 { margin: 0 0 12px; font-size: 15px; }
.settings-form .field { margin-bottom: 10px; }
.colour-preview { width: 20px; height: 20px; border-radius: 5px; display: inline-block; vertical-align: -5px; margin-right: 6px; border: 1px solid rgba(0,0,0,.18); }

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  max-width: 420px; padding: 11px 14px;
  border-radius: 9px; background: #172033; color: #fff; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s ease;
  font-size: 13px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #9c1721; }
.loading-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(255,255,255,.72);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-weight: 800;
}
.spinner { width: 32px; height: 32px; border: 4px solid #d0d5dd; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1080px) {
  .filter-note { display: none; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-card.span-4 { grid-column: 1 / -1; }
  .summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: 1fr; }
}

@media print {
  body { min-width: 0; background: #fff; }
  .topbar, .toolbar, .filter-row, .onboarding, .planner-header-note, .modal-backdrop, .toast, .loading-overlay { display: none !important; }
  .planner-card { margin: 0; box-shadow: none; border: 0; }
  .planner-scroll { max-height: none; overflow: visible; }
  .planner-corner, .resource-label, .date-header-cell { position: static; }
  .course-card { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: landscape; margin: 8mm; }
}

/* Authentication and user management (v0.2.0) */
#appShell { min-width: 920px; }
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 15% 15%, rgba(120, 200, 80, .24), transparent 34%),
    linear-gradient(145deg, #111827, #25314a 58%, #172033);
}
.auth-card {
  width: min(470px, calc(100vw - 36px));
  padding: 28px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 24px 70px rgba(0,0,0,.38);
}
.auth-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.auth-brand h1 { margin: 0; font-size: 20px; }
.auth-brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.auth-brand .version-badge { color: var(--ink); border-color: var(--line); }
.auth-copy { margin: 20px 0 16px; }
.auth-copy h2 { margin: 4px 0 4px; font-size: 25px; }
.auth-copy p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-form .field label { font-size: 13px; }
.auth-form .field input { min-height: 44px; }
.auth-submit { width: 100%; min-height: 44px; margin-top: 2px; }
.auth-notice {
  padding: 10px 12px;
  border: 1px solid #d6c16e;
  border-radius: 8px;
  background: #fff9df;
  color: #654f13;
  font-size: 12px;
}
.field-help { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.signed-in-label {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d5deed;
  font-size: 12px;
  font-weight: 800;
}
.user-security-note {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #f5f8fc;
  color: #475467;
  font-size: 12px;
}
.user-status {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eaf5e3;
  color: #315b25;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.user-status.inactive { background: #f2f4f7; color: var(--muted); }
.current-user-chip { background: #e7f2ff; color: #24558e; }

@media (max-width: 760px) {
  .auth-screen { padding: 16px; }
  .auth-card { padding: 21px; }
}
.auth-help { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }

/* v0.3.2 configurable staff availability */
.staff-section-label,.staff-section-track{background:#f7c9aa!important;border-top:3px solid #8a4d24!important}.staff-resource-label{min-height:54px!important;padding:8px 12px}.staff-track{min-height:54px!important;user-select:none}.staff-day-cell{cursor:crosshair;transition:background .08s ease,box-shadow .08s ease}.staff-day-cell:hover{box-shadow:inset 0 0 0 2px rgba(138,77,36,.35)}.staff-day-cell.selecting{background:#ffe1a6!important;box-shadow:inset 0 0 0 2px #8a4d24}.staff-event-card{z-index:12;margin:5px 3px;padding:5px 8px;border:1px solid #3b3b3b;border-radius:3px;font-weight:800;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:pointer}.read-only-note{font-weight:700}.user-role-chip{padding:2px 6px;border-radius:999px;background:#eef2f6;font-size:11px}

/* v0.4.0 customer delegate link controls */
.customer-link-card {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid #b8cfaa;
  border-left: 6px solid var(--primary);
  border-radius: 10px;
  background: #f7fbf4;
}
.customer-link-card h3 { margin: 4px 0 5px; font-size: 17px; }
.customer-link-card p { margin: 4px 0; }
.customer-link-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.customer-link-row { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; gap: 8px; margin-top: 14px; }
.customer-link-row input { min-width: 0; background: #fff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.customer-link-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.customer-link-warning { padding: 9px 11px; border: 1px solid #e1c04f; border-radius: 7px; background: #fff8d9; color: #6b5000; }
.customer-link-security { color: var(--muted); font-size: 12px; }
@media (max-width: 820px) {
  .customer-link-row { grid-template-columns: 1fr; }
  .customer-link-heading { flex-direction: column; }
}

/* v0.4.1 open-course company allocation links */
.customer-mode-field { min-width: 280px; }
.customer-mode-content { margin-top: 16px; }
.customer-allocation-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.customer-allocation-summary > div {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8f9fb;
}
.customer-allocation-summary strong { display: block; font-size: 22px; }
.customer-allocation-summary span { color: var(--muted); font-size: 11px; }
.customer-allocation-add-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  margin-bottom: 14px;
}
.customer-allocation-list { display: grid; gap: 12px; }
.customer-allocation-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.customer-allocation-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.customer-allocation-heading h4 { margin: 3px 0 2px; font-size: 16px; }
.customer-allocation-heading p { margin: 0; }
.customer-allocation-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px minmax(220px, .8fr);
  gap: 10px;
  align-items: end;
}
.checkbox-card.compact { min-height: 64px; margin: 0; }
.checkbox-card.compact small { display: block; }
@media (max-width: 1000px) {
  .customer-allocation-summary { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .customer-allocation-add-form,
  .customer-allocation-fields { grid-template-columns: 1fr; }
  .customer-mode-field { width: 100%; min-width: 0; }
}

/* v0.4.3 admin notifications */
.notification-button { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.notification-badge {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: #ef4444; color: #fff; border: 1px solid rgba(255,255,255,.55);
  font-size: 10px; font-weight: 900; line-height: 1;
}
.notification-body { min-height: 410px; }
.notification-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; color: var(--muted); font-size: 12px;
}
.notification-list { display: flex; flex-direction: column; gap: 9px; }
.notification-item {
  display: grid; grid-template-columns: 1fr auto; gap: 14px;
  padding: 12px 13px; border: 1px solid var(--line-soft); border-radius: 9px;
  background: #fff;
}
.notification-item.unread { background: #f1f8ed; border-color: #a7c99a; box-shadow: inset 4px 0 0 var(--primary); }
.notification-item-main { min-width: 0; }
.notification-item-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 4px; }
.notification-item-title strong { font-size: 13px; }
.notification-item p { margin: 0; color: #344054; font-size: 12px; overflow-wrap: anywhere; }
.notification-item-meta { margin-top: 6px; color: var(--muted); font-size: 11px; }
.notification-item-actions { display: flex; align-items: flex-start; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.notification-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); display: inline-block; }
.notification-empty { padding: 48px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 9px; }

@media (max-width: 760px) {
  .notification-item { grid-template-columns: 1fr; }
  .notification-item-actions { justify-content: flex-start; }
}

/* v0.4.4 customer certificate, invoice and purchase-order details */
.customer-booking-details {
  margin: 12px 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
}
.customer-booking-details.missing { background: #fffaf0; border-color: #dfbd43; }
.customer-booking-details-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}
.customer-booking-details-heading strong { display: block; margin-top: 2px; }
.customer-booking-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}
.customer-booking-details-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}
.customer-booking-details-grid span,
.customer-booking-details-grid small { display: block; color: var(--muted); font-size: 11px; }
.customer-booking-details-grid strong { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.customer-booking-details-grid p { margin: 3px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.customer-booking-details-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .customer-booking-details-heading { display: grid; }
  .customer-booking-details-grid { grid-template-columns: 1fr; }
  .customer-booking-details-grid .span-all { grid-column: auto; }
}

/* v0.5.0 private course documents */
.documents-loading {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 750;
}
.mini-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #dfe5ec;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.document-upload-card,
.document-list-section,
.superseded-documents {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.document-upload-card {
  margin-bottom: 16px;
  border-left: 6px solid var(--primary);
  background: #f8fbf6;
}
.document-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.document-section-heading h3 { margin: 3px 0 4px; font-size: 17px; }
.document-section-heading p { margin: 0; color: var(--muted); font-size: 12px; max-width: 760px; }
.document-upload-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
}
.document-upload-form .form-actions { display: flex; justify-content: flex-end; }
.document-list { display: grid; gap: 10px; }
.document-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fbfcfd;
}
.document-card.superseded { background: #f6f7f9; opacity: .86; }
.document-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e8eef6;
  border: 1px solid #c7d2e1;
  color: #344054;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .03em;
}
.document-card-main { min-width: 0; }
.document-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.document-card-heading h4 { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.document-filename { margin-top: 4px; color: #344054; font-size: 12px; overflow-wrap: anywhere; }
.document-meta { display: flex; flex-wrap: wrap; gap: 5px 13px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.document-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.superseded-documents { margin-top: 14px; background: #f8f9fb; }
.superseded-documents > summary { cursor: pointer; font-weight: 850; }
.superseded-documents[open] > summary { margin-bottom: 12px; }
.customer-document-summary { display: grid; gap: 4px; margin-top: 4px; }
.customer-document-summary .document-actions { justify-content: flex-start; margin-top: 4px; }
@media (max-width: 900px) {
  .document-upload-form { grid-template-columns: 1fr; }
  .document-upload-form .span-2 { grid-column: auto; }
  .document-card { grid-template-columns: 44px minmax(0, 1fr); }
  .document-icon { width: 42px; height: 42px; }
  .document-card > .document-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* v0.6.0 controlled Course Types and joining-instructions administration */
.update-confirmation-banner {
  margin: 12px 14px 0;
  padding: 12px 16px;
  border: 1px solid #d0a022;
  border-radius: var(--radius);
  background: #fff8df;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 3px 12px rgba(16, 24, 40, .08);
}
.update-confirmation-banner div { display: flex; flex-direction: column; gap: 2px; }
.update-confirmation-banner span { color: #725c16; font-size: 12px; }
.custom-title-indicator {
  display: inline-flex;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff2cc;
  color: #7a5a00;
  font-size: 10px;
  font-weight: 900;
  vertical-align: 1px;
}
.pre-course-heading,
.pre-course-save-bar,
.section-heading.compact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.pre-course-heading { margin-bottom: 14px; }
.pre-course-heading h3,
.section-heading.compact h4 { margin: 2px 0 3px; }
.pre-course-heading p,
.section-heading.compact p { margin: 0; color: var(--muted); }
.pre-course-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pre-course-form { display: grid; gap: 14px; }
.pre-course-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 2px 9px rgba(16, 24, 40, .04);
}
.pre-course-suggestion {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #9cbce8;
  border-radius: 8px;
  background: #eef5ff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.schedule-editor { display: grid; gap: 7px; }
.schedule-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 170px 170px;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #f8fafc;
}
.schedule-row label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; }
.schedule-row input { min-width: 0; }
.pre-course-save-bar {
  position: sticky;
  bottom: -1px;
  z-index: 5;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid #afbdd2;
  border-radius: 8px;
  background: rgba(245, 248, 252, .96);
  box-shadow: 0 -3px 12px rgba(16, 24, 40, .08);
}
.pre-course-save-bar span { color: var(--muted); font-weight: 800; }
.ji-output-card { margin-top: 16px; }
.ji-company-group { margin-top: 14px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.ji-company-group > header { padding: 11px 14px; background: #e9eef5; border-bottom: 1px solid var(--line); }
.ji-company-group h4 { margin: 1px 0 0; }
.ji-recipient-list { display: grid; }
.ji-recipient-row {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(340px, 1fr) auto;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
}
.ji-recipient-row:last-child { border-bottom: 0; }
.ji-recipient-row.status-blocked { border-left: 5px solid #c82d37; }
.ji-recipient-row.status-out-of-date { border-left: 5px solid #b56b00; background: #fffaf0; }
.ji-recipient-row.status-not-yet-generated { border-left: 5px solid #667085; }
.ji-recipient-row.status-not-yet-sent { border-left: 5px solid #2358a8; }
.ji-recipient-row.status-current-sent { border-left: 5px solid #4e8f2f; }
.ji-recipient-row.status-no-longer-valid { border-left: 5px solid #98a2b3; background: #f7f7f8; }
.ji-recipient-heading { display: flex; align-items: center; gap: 10px; }
.ji-recipient-heading > div { display: flex; flex-direction: column; min-width: 0; }
.ji-recipient-heading > div span { color: var(--muted); font-size: 11px; }
.ji-status { margin-left: auto; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.ji-status.blocked, .ji-status.no-longer-valid { background: #f5d4d6; color: #8d1d25; }
.ji-status.out-of-date { background: #ffe5ad; color: #805400; }
.ji-status.not-yet-generated { background: #e4e7ec; color: #344054; }
.ji-status.not-yet-sent { background: #dbeafe; color: #174789; }
.ji-status.current-sent { background: #dff1d4; color: #315e1e; }
.ji-recipient-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ji-reasons { margin: 8px 0 4px 28px; padding: 0; color: #9a2630; font-size: 12px; }
.ji-warnings { margin: 8px 0 4px 28px; padding: 0; color: #7a5600; font-size: 12px; }
.ji-warnings li::marker { color: #d39b00; }
.ji-issue-link { margin: 6px 0 0 28px; padding: 0; border: 0; background: transparent; color: #2358a8; font-size: 11px; font-weight: 800; text-decoration: underline; }
.ji-issue-note { display: block; margin: 6px 0 0 28px; color: var(--muted); font-size: 11px; }
.ji-po-control { margin: 8px 0 0 28px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; }
.ji-po-control label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.ji-send-rows { display: grid; gap: 12px; }
.ji-send-row { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #f9fafb; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.ji-send-row > div:first-child { grid-column: 1 / -1; display: flex; flex-direction: column; }
.ji-send-row > div:first-child span { color: var(--muted); font-size: 11px; }
.ji-send-row .checkbox-card { grid-column: 1 / -1; }
.ji-history-list { display: grid; gap: 12px; }
.ji-history-version { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.ji-history-heading { padding: 12px 14px; background: #eef2f7; display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.ji-history-heading > div:first-child { display: flex; flex-direction: column; }
.ji-history-heading span { color: var(--muted); font-size: 11px; }
.ji-send-history { padding: 8px 14px 12px; display: grid; gap: 7px; }
.ji-send-history-row { padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 6px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.ji-send-history-row > div { display: flex; flex-direction: column; }
.ji-send-history-row span { color: var(--muted); font-size: 11px; }
.ji-send-history-row.entered-error { opacity: .7; background: #f5f5f5; text-decoration: line-through; }
.course-type-settings-layout { grid-template-columns: minmax(360px, 1fr) minmax(420px, .85fr); }
.course-type-list-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.course-type-list-header input { width: min(260px, 48%); }
.course-type-settings-form { max-height: 64vh; overflow: auto; padding-right: 5px; }

@media (max-width: 1100px) {
  .schedule-row { grid-template-columns: 1fr 145px 145px; }
  .ji-recipient-row { grid-template-columns: 1fr; }
  .ji-recipient-actions { justify-content: flex-start; }
  .course-type-settings-layout { grid-template-columns: 1fr; }
}

/* v0.6.1 bank holidays and company closure days */
.date-header-cell.closure {
  background: #dceffc;
  height: 82px;
  padding: 4px 6px;
}
.date-header-cell.today.closure { background: #d4ebfb; }
.day-background { position: relative; overflow: hidden; }
.day-background.closure,
.day-background.weekend.closure,
.day-background.today.closure { background: #eef8ff; }
.day-background.closure.course-create-cell:hover,
.day-background.closure.course-create-cell:focus-visible { background: #e0f2ff; }
.calendar-closure-label {
  display: block;
  max-width: 100%;
  padding: 2px 5px;
  color: #24587a;
  font-size: 9px;
  line-height: 1.2;
  font-weight: 800;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  pointer-events: none;
}
.day-background > .calendar-closure-label {
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  z-index: 1;
  border: 1px solid rgba(56, 126, 167, .18);
  border-radius: 4px;
  background: rgba(255, 255, 255, .72);
}
.date-header-cell > .calendar-closure-label {
  width: 100%;
  margin-top: 1px;
}

.calendar-settings-layout { grid-template-columns: minmax(340px, .9fr) minmax(360px, 1.1fr); }
.calendar-region-grid { display: grid; gap: 8px; margin: 10px 0 14px; }
.calendar-region-option { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: #fff; }
.calendar-region-option input { width: 17px; height: 17px; }
.closure-settings-list { display: grid; gap: 9px; margin-top: 12px; }
.closure-settings-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 9px; background: #fff; }
.closure-settings-row-main { display: grid; gap: 3px; min-width: 0; }
.closure-settings-row-main span { color: var(--muted); font-size: 12px; }
.closure-settings-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 900px) { .calendar-settings-layout { grid-template-columns: 1fr; } }

/* v0.6.1 date headers reserve space for visible closure labels. */
.planner-corner { min-height: 82px; }

/* v0.6.2 uses the existing danger-button styling for permanent course deletion. */

/* v0.6.4 trainer comments, planner PDF controls and Course Type usability */
:root { --comment-width: 240px; }
.planner-print-actions { display: flex; align-items: end; gap: 7px; flex-wrap: wrap; }
.date-header-cell.comment-header {
  width: var(--comment-width);
  min-width: var(--comment-width);
  background: #e8e4dc;
  border-left: 2px solid #98a2b3;
}
.date-header-cell.comment-header .comment-title { font-size: 14px; font-weight: 900; }
.weekly-comment-cell {
  position: relative;
  z-index: 4;
  min-width: var(--comment-width);
  width: var(--comment-width);
  min-height: 100%;
  padding: 8px;
  border-left: 2px solid #98a2b3;
  border-right: 1px solid var(--line);
  background: #f4f1ea;
  color: #344054;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.weekly-comment-cell.read-only { overflow: auto; }
.weekly-comment-cell.unavailable { color: #98a2b3; font-style: italic; display: flex; align-items: center; justify-content: center; text-align: center; }
.weekly-comment-input {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 154px;
  resize: none;
  border: 1px solid #c8c2b6;
  border-radius: 7px;
  padding: 9px;
  background: rgba(255,255,255,.75);
  color: #182230;
  font: inherit;
  line-height: 1.35;
}
.weekly-comment-input:focus { outline: 3px solid rgba(59,130,246,.22); border-color: #6798d8; }
.staff-comment-cell { min-height: 54px; padding: 0; }

.course-type-settings-list { max-height: 68vh; overflow: auto; }
.course-type-settings-form {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 74vh;
  overflow: auto;
  padding-right: 7px;
}
.settings-row.selected {
  background: #eaf4ff;
  box-shadow: inset 4px 0 0 #2f6fb5;
  border-color: #a8c8eb;
}
.course-type-list-header {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 8px;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
}

@media (max-width: 1100px) {
  .course-type-settings-form { position: static; max-height: none; }
  .course-type-settings-list { max-height: 48vh; }
  .planner-print-actions { width: 100%; }
}

/* ========================================================================
   v0.7.0 - Post-course Admin and self-directed e-learning
   ======================================================================== */
.full-screen-workspace { width: min(1500px, calc(100vw - 34px)); height: min(940px, calc(100vh - 34px)); display: flex; flex-direction: column; }
.full-screen-workspace .workspace-body { flex: 1; min-height: 0; overflow: auto; }
.workspace-tabs { flex: 0 0 auto; padding: 0 20px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.v070-workspace-tab { padding: 12px 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-weight: 850; }
.v070-workspace-tab.active { border-bottom-color: var(--primary); color: var(--ink); }
.v070-workspace-panel { display: none; }
.v070-workspace-panel.active { display: block; }
.v070-master-detail { display: grid; grid-template-columns: minmax(290px, 360px) minmax(600px, 1fr); min-height: 640px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.v070-master-list { min-width: 0; border-right: 1px solid var(--line); background: #f8fafc; }
.v070-list-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); background: #fff; }
.v070-list-toolbar input, .v070-list-toolbar select { min-width: 0; }
.v070-list-item { width: 100%; display: grid; gap: 3px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; color: var(--ink); }
.v070-list-item:hover { background: #eef4f8; }
.v070-list-item.selected { background: #e4f0df; box-shadow: inset 4px 0 0 var(--primary); }
.v070-list-item strong { font-size: 13px; }
.v070-list-item span, .v070-list-item small { color: var(--muted); }
.v070-detail-pane { min-width: 0; padding: 18px; overflow: auto; }
.v070-work-form { display: grid; gap: 16px; }
.v070-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.v070-section-heading h3, .v070-section-heading h4 { margin: 3px 0 4px; }
.v070-section-heading p { margin: 0; color: var(--muted); }
.v070-subsection { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.v070-subsection > h4 { margin: 0 0 12px; }
.compact-form { align-items: end; }
.v070-status { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; border-radius: 999px; border: 1px solid #cbd5e1; background: #f1f5f9; color: #475467; font-size: 10px; font-weight: 900; line-height: 1.2; white-space: nowrap; text-transform: none; }
.v070-status-completed, .v070-status-current, .v070-status-active, .v070-status-passed { background: #eaf6e4; border-color: #a5cf90; color: #2c5c20; }
.v070-status-pending, .v070-status-out-of-date, .v070-status-awaiting-invoice { background: #fff6d6; border-color: #e4c96a; color: #6d5200; }
.v070-status-failed, .v070-status-missing, .v070-status-changed-after-sent, .v070-status-beyond-purchased { background: #fff0f1; border-color: #efb4b8; color: #9f2028; }
.v070-status-incomplete, .v070-status-did-not-attend, .v070-status-not-attempted, .v070-status-fully-used { background: #f2f4f7; color: #475467; }
.v070-status-wrap { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.v070-warning { margin: 12px 0; padding: 12px 14px; border: 1px solid #e4c96a; border-radius: 9px; background: #fff8dd; color: #6d5200; }
.v070-result-cards { display: grid; gap: 12px; }
.v070-result-card { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 2px 8px rgba(16,24,40,.05); }
.v070-result-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.v070-result-card h4 { margin: 0 0 3px; }
.v070-result-card header span { color: var(--muted); font-size: 12px; }
.v070-requirements-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.v070-requirements-grid > div { padding: 9px 10px; border-radius: 8px; background: #f8fafc; }
.v070-requirements-grid span { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.v070-requirements-grid p { margin: 4px 0 0; white-space: pre-wrap; }
.v070-attempt-list { display: grid; gap: 6px; margin: 10px 0; }
.v070-attempt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: #fbfcfd; }
.v070-attempt-row div { display: grid; gap: 2px; }
.v070-attempt-row span, .v070-attempt-row small { color: var(--muted); font-size: 12px; }
.v070-result-form { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 9px; align-items: end; margin-top: 10px; padding: 11px; border-radius: 9px; background: #f1f5f9; }
.v070-result-form .field { min-width: 0; }
.v070-cert-state { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; padding: 10px; border-radius: 8px; background: #eef7ea; border: 1px solid #b7d6a8; }
.v070-cert-state.missing { background: #fff6d6; border-color: #e4c96a; }
.v070-cert-state div:first-child { display: grid; gap: 2px; }
.v070-cert-state span { color: var(--muted); font-size: 12px; }
.v070-cert-state.not-required { background: #f5f7fa; border-color: var(--line); }
.certificate-badge-setting { align-items: flex-start; }
.certificate-badge-preview { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; }
.certificate-badge-preview img { display: block; max-width: 240px; max-height: 90px; object-fit: contain; background: #fff; border: 1px solid var(--line-soft); border-radius: 7px; padding: 8px; }
.certificate-badge-upload { width: fit-content; }
.v070-report-section { margin-top: 20px; }
.v070-report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 12px; }
.v070-report-card, .v070-batch-card { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.v070-report-card header, .v070-batch-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.v070-report-card header div:first-child, .v070-batch-card header div:first-child { display: grid; gap: 2px; }
.v070-report-card header span, .v070-batch-card header span { color: var(--muted); font-size: 12px; }
.v070-report-card p, .v070-batch-card p { color: var(--muted); font-size: 12px; }
.v070-post-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.v070-batch-list { display: grid; gap: 10px; }
.v070-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.v070-metric-grid > div { display: grid; gap: 2px; padding: 9px; border-radius: 8px; background: #f8fafc; text-align: center; }
.v070-metric-grid span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.licence-filter-bar { flex-wrap: wrap; padding: 0 0 12px; background: transparent; }
.licence-filter-bar select { max-width: 300px; }
.v070-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 7px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.v070-check-grid.compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.v070-check-grid legend { padding: 0 6px; font-weight: 900; }
.v070-check-grid label { display: flex; gap: 7px; align-items: flex-start; font-size: 12px; }
.v070-check-grid input { width: auto; margin-top: 2px; }
.table-scroll { overflow: auto; }
.v070-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.v070-table th, .v070-table td { padding: 9px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.v070-table th { position: sticky; top: 0; z-index: 2; background: #eef1f5; text-align: left; }
.v070-table tr.invalid-row td { background: #fff5f5; }
.v070-table small { display: block; margin-top: 3px; color: var(--muted); }
.inline-error { display: inline-block; padding: 5px 7px; }
.v070-pending-list { display: grid; gap: 9px; }
.v070-pending-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.v070-pending-card > div:first-child { display: grid; gap: 2px; }
.v070-pending-card span, .v070-pending-card small { color: var(--muted); }
.v070-action-list { display: grid; gap: 8px; }
.v070-action-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.v070-action-item.updated { border-color: #d7a900; box-shadow: 0 0 0 3px rgba(215,169,0,.14); }
.v070-action-item > div:first-child { display: grid; gap: 3px; }
.v070-action-item span { color: var(--muted); }
.v070-profile-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; }
.v070-profile-search, .v070-profile-detail { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.v070-profile-match { width: 100%; display: grid; gap: 3px; padding: 10px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; }
.v070-profile-match:hover { background: #f1f5f9; }
.v070-profile-match span { color: var(--muted); font-size: 12px; }
.v070-history-list { display: grid; gap: 9px; }
.v070-history-list article { padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.v070-history-list article > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.v070-history-list p { margin: 5px 0; color: var(--muted); }
.v070-brand-preview { min-height: 145px; padding: 18px; border: 1px solid var(--line); background: #fff; }
.v070-brand-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.v070-brand-header.center { flex-direction: column; align-items: center; text-align: center; }
.v070-brand-header.right { flex-direction: row-reverse; text-align: right; }
.v070-brand-header img { max-height: 80px; object-fit: contain; }
.elearning-row-label { background: #e9f3f7; }
.elearning-planner-track { min-height: 86px; background: #f7fbfd; }
.elearning-day-cell { padding: 5px; overflow: auto; }
.elearning-planner-card { width: 100%; display: grid; gap: 2px; margin-bottom: 4px; padding: 6px 7px; border: 1px solid #83b1c4; border-left: 5px solid #236f8e; border-radius: 7px; background: #dff0f6; text-align: left; color: var(--ink); }
.elearning-planner-card.invoiced { opacity: .68; border-left-color: #7d8b95; background: #edf1f3; }
.elearning-planner-card.not-invoiced { box-shadow: 0 0 0 2px rgba(222,150,0,.12); }
.elearning-planner-card span, .elearning-planner-card small { color: var(--muted); font-size: 10px; }
.elearning-summary-cell { display: grid; place-content: center; gap: 2px; text-align: center; }
.elearning-summary-cell strong { font-size: 18px; }
.v070-enrolment-table td:first-child { min-width: 175px; }
.v070-enrolment-table .footer-actions { flex-wrap: nowrap; }

@media (max-width: 1100px) {
  .v070-master-detail { grid-template-columns: 300px minmax(560px, 1fr); }
  .v070-result-form { grid-template-columns: 1fr 1fr; }
  .v070-result-form .button { justify-self: start; }
  .v070-requirements-grid { grid-template-columns: 1fr; }
  .v070-profile-layout { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .full-screen-workspace { width: calc(100vw - 12px); height: calc(100vh - 12px); }
  .workspace-tabs { overflow-x: auto; display: flex; }
  .v070-master-detail { display: block; }
  .v070-master-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 300px; overflow: auto; }
  .v070-result-form, .v070-metric-grid { grid-template-columns: 1fr; }
  .v070-pending-card, .v070-action-item, .v070-cert-state { align-items: flex-start; flex-direction: column; }
}

/* v0.7.0 merge, certificate preview and version-history refinements */
.v070-file-order { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; }
.v070-file-order-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.v070-file-order-heading span { color: var(--muted); font-size: 12px; }
.v070-file-order-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 8px; border-top: 1px solid var(--line-soft); background: #fff; }
.v070-file-order-row:first-of-type { border-top: 0; }
.button.tiny { min-height: 26px; padding: 2px 7px; font-size: 11px; }
.v070-certificate-history { margin-top: 8px; }
.v070-certificate-history > summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 800; }
.v070-certificate-history .v070-history-list { margin-top: 8px; }
.v070-certificate-history article { padding: 9px; }
.v070-merge-search-grid, .v070-merge-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.v070-selected-profile, .v070-merge-history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.v070-selected-profile > div, .v070-merge-history-row > div { display: grid; gap: 3px; }
.v070-selected-profile span, .v070-merge-history-row span { color: var(--muted); font-size: 12px; }
.v070-merge-profile-summary { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.v070-merge-profile-summary h4 { margin: 0 0 4px; }
.v070-merge-profile-summary > p { margin: 0 0 10px; color: var(--muted); }
.v070-merge-profile-summary .v070-history-list > div { display: grid; gap: 2px; padding: 7px; border-radius: 7px; background: #fff; }
.v070-merge-profile-summary .v070-history-list span { color: var(--muted); font-size: 12px; }
.v070-check-list { display: grid; gap: 7px; }
.v070-check-list label { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border: 1px solid var(--line-soft); border-radius: 7px; background: #fff; }
.v070-check-list input { width: auto; margin-top: 3px; }
@media (max-width: 900px) { .v070-merge-search-grid, .v070-merge-comparison { grid-template-columns: 1fr; } }


/* v0.7.1 closed-course customer assignment */
.closed-customer-assignment {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin: 12px 0 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #f8fafc;
}
.closed-customer-assignment .field { margin: 0; }
.closed-customer-current { margin: 5px 0 10px; color: #344054; }
@media (max-width: 720px) {
  .closed-customer-assignment { grid-template-columns: 1fr; align-items: stretch; }
}

.button.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* v0.7.2 usability refinements */
.planner-corner { height:64px; min-height:64px; box-sizing:border-box; padding:0 14px; display:flex; align-items:center; }
.v070-result-form.scored { grid-template-columns:minmax(145px,.8fr) minmax(190px,1.15fr) minmax(150px,.85fr) minmax(135px,.7fr) auto; align-items:end; }
.v070-result-form .field { display:grid; grid-template-rows:auto 38px minmax(18px,auto); align-content:end; }
.v070-result-form .field input, .v070-result-form .field select { height:38px; box-sizing:border-box; }
.v070-result-form .field small { min-height:18px; }
.v072-result-submit { display:flex; align-items:flex-end; min-height:76px; padding-bottom:18px; }
.v072-result-submit .button { white-space:nowrap; }
@media (max-width:1100px){.v070-result-form.scored{grid-template-columns:1fr 1fr}.v072-result-submit{min-height:auto;padding-bottom:0;}}

/* v0.7.4 planner spacing and e-learning licence approval */
.resource-label { padding-top:5px; padding-bottom:21px; }
.course-card { margin-top:1px; margin-bottom:13px; }
.weekly-comment-cell { padding-top:1px; padding-bottom:15px; }
.v073-licence-approval { border-color:#b8c9da; background:#f8fbfe; }
.v073-approval-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:10px 0; }
.v073-approval-grid > div { padding:10px 12px; border:1px solid var(--line-soft); border-radius:8px; background:#fff; }
.v073-approval-grid span { display:block; color:var(--muted); font-size:11px; }
.v073-approval-grid strong { display:block; margin-top:3px; font-size:15px; overflow-wrap:anywhere; }
.v073-po-document { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid var(--line-soft); border-radius:8px; background:#fff; }
.v073-po-document strong { overflow-wrap:anywhere; }
@media (max-width:900px){.v073-approval-grid{grid-template-columns:1fr 1fr}.v073-po-document{align-items:flex-start;flex-direction:column}}

/* v0.7.4 certificate batch selection */
.v074-delegate-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.v074-certificate-select { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.v074-certificate-select input { width: 16px; height: 16px; margin: 0; }


/* v0.7.6 certificate-template and planner-grid refinements */
/* Keep every planner header cell on one fixed-height row, including closure days.
   Previously a closure header could grow to 82px and leave an 18px white strip
   under the normal date/comment headers before the first trainer row. */
.planner-corner,
.date-header-cell,
.date-header-cell.closure {
  height: 64px;
  min-height: 64px;
}
.date-header-cell.closure {
  padding: 2px 4px;
  gap: 0;
}
.date-header-cell.closure > .calendar-closure-label {
  margin-top: 0;
  padding: 1px 3px;
  font-size: 8px;
  line-height: 1.05;
}

/* Remove the artificial v0.7.4 vertical padding that made row boundaries look
   detached, while keeping the established trainer-row dimensions. */
.resource-label { padding: 13px 12px; }
.weekly-comment-cell { padding: 8px; }
.staff-comment-cell { padding: 0; }

/* Staff rows can become a few pixels taller than their 54px minimum because of
   text metrics. Let the date/comment cells fill the actual grid-row height rather
   than leaving a white strip underneath the fixed 54px inner track. */
.staff-track {
  min-height: 54px !important;
  align-items: stretch;
}
.staff-section-track {
  min-height: 54px !important;
  align-items: stretch;
  grid-auto-rows: minmax(0, 1fr);
}
.staff-day-cell,
.staff-comment-cell {
  height: 100%;
  min-height: 0;
  align-self: stretch;
}

/* v0.7.6 editable certificate front-page background */
.certificate-background-settings { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr); gap: 22px; align-items: start; }
.certificate-background-controls { max-width: none; }
.certificate-background-current { margin: 12px 0 14px; padding: 12px; min-height: 260px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: #eef2f6; }
.certificate-background-current img { display: block; max-width: 100%; width: auto; height: auto; max-height: 520px; object-fit: contain; background: #fff; box-shadow: 0 2px 10px rgba(15, 23, 42, .12); }
.certificate-background-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0 0 14px; }
.certificate-background-meta div { min-width: 0; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: #f8fafc; }
.certificate-background-meta dt { margin: 0 0 3px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.certificate-background-meta dd { margin: 0; overflow-wrap: anywhere; }
.certificate-background-actions { flex-wrap: wrap; justify-content: flex-start; }
.certificate-background-help { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.certificate-background-help h3 { margin-top: 0; }
.certificate-background-help p { color: var(--muted); line-height: 1.55; }
.certificate-background-warning { margin: 0 0 14px; }
@media (max-width: 950px) { .certificate-background-settings { grid-template-columns: 1fr; } .certificate-background-meta { grid-template-columns: 1fr; } }

/* v0.7.7 overseas course time zones and UK-equivalent display */
.time-zone-preview {
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid #c9d6e7;
  border-radius: 7px;
  background: #f5f8fc;
  display: grid;
  gap: 2px;
}
.time-zone-preview span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.time-zone-preview strong { color: #173f70; font-size: 15px; }
.time-zone-preview small { color: var(--muted); font-size: 11px; }
.course-card-time {
  display: grid;
  gap: 2px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(0,0,0,.13);
  font-size: 13px;
  line-height: 1.2;
}
.course-card-time strong { font-size: 14px; }
.course-card-time small { color: rgba(0,0,0,.7); font-size: 11px; font-weight: 800; }
.detail-time-summary { display: inline-flex; flex-direction: column; gap: 1px; }
.detail-time-summary small { color: var(--muted); font-size: 11px; font-weight: 800; }
.time-zone-detail { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.time-zone-detail strong { color: #173f70; font-size: 12px; }

/* v0.7.8 public booking capacity and administration */
.course-card-capacity {
  display: block;
  margin-top: 6px;
  padding: 5px 7px;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 6px;
  background: rgba(255,255,255,.58);
  color: rgba(0,0,0,.76);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.summary-cards.capacity-breakdown { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.capacity-breakdown-note {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 11px;
}
.customer-allocation-summary.capacity-breakdown { grid-template-columns: repeat(6, minmax(110px, 1fr)); }
.public-link-card {
  margin: 16px 0;
  padding: 15px;
  border: 1px solid #9fc3e9;
  border-left: 6px solid #3b78b8;
  border-radius: 10px;
  background: #f4f9ff;
}
.public-link-card.disabled { border-color: var(--line); border-left-color: #98a2b3; background: #f8f9fb; }
.public-link-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 9px;
  margin: 12px 0 4px;
}
.public-link-metrics > div,
.public-booking-match-grid > div {
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}
.public-link-metrics strong { display: block; font-size: 21px; }
.public-link-metrics span,
.public-booking-match-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.settings-section-heading { margin: 18px 0 10px; }
.settings-section-heading h4 { margin: 3px 0 3px; font-size: 16px; }
.settings-section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.public-booking-records,
.reserved-allocation-section { margin-top: 20px; }
.public-booking-record-list { display: grid; gap: 12px; }
.public-booking-record {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.public-booking-record.needs-review {
  border-color: #d8b43a;
  box-shadow: inset 5px 0 0 #e2bd3d;
  background: #fffcf0;
}
.public-booking-record-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.public-booking-record-heading h4 { margin: 3px 0 2px; font-size: 16px; }
.public-booking-record-heading p { margin: 0; }
.public-booking-match-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.public-booking-match-grid strong { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.public-booking-review-note {
  padding: 9px 11px;
  border: 1px solid #e1c04f;
  border-radius: 7px;
  background: #fff8d9;
  color: #6b5000;
  font-size: 11px;
}
.public-booking-company-resolution {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 9px;
  align-items: end;
  margin-top: 10px;
}
.public-booking-management-row { margin-bottom: 12px; }
.button.disabled { opacity: .55; pointer-events: none; }
@media (max-width: 1180px) {
  .summary-cards.capacity-breakdown,
  .customer-allocation-summary.capacity-breakdown { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
}
@media (max-width: 820px) {
  .summary-cards.capacity-breakdown,
  .customer-allocation-summary.capacity-breakdown,
  .public-link-metrics,
  .public-booking-match-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .public-booking-record-heading { flex-direction: column; }
  .public-booking-company-resolution { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .summary-cards.capacity-breakdown,
  .customer-allocation-summary.capacity-breakdown,
  .public-link-metrics,
  .public-booking-match-grid { grid-template-columns: 1fr; }
}

/* v0.7.8 grouped settings navigation */
.settings-group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 9px 20px;
  background: #f4f6f8;
}
.settings-group-button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 9px 14px;
  color: var(--muted);
  font-weight: 900;
}
.settings-group-button:hover { background: #fff; border-color: var(--line-soft); color: var(--ink); }
.settings-group-button.active {
  border-color: #b8cfaa;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(16,24,40,.08);
}
.settings-subnav-shell {
  min-height: 49px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfcfd;
}
.settings-subnav {
  display: none;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 20px;
}
.settings-subnav.active { display: flex; }
.settings-subnav .settings-tab-button { min-height: 48px; }
@media (max-width: 760px) {
  .settings-group-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 14px; }
  .settings-group-button { text-align: center; }
  .settings-subnav { padding: 0 10px; overflow-x: auto; flex-wrap: nowrap; }
  .settings-subnav .settings-tab-button { flex: 0 0 auto; }
}

/* v0.7.8 customer matching review and company merge tools */
.company-review-section,
.company-merge-section {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fbfcfd;
}
.company-review-section { margin-bottom: 18px; }
.company-merge-section { margin-top: 18px; }
.company-review-section > .settings-section-heading,
.company-merge-section > .settings-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px;
}
.company-review-section h3,
.company-merge-section h3 { margin: 3px 0; font-size: 17px; }
.company-match-review-list { display: grid; gap: 10px; }
.company-match-review {
  padding: 13px;
  border: 1px solid #dfbd43;
  border-left: 5px solid #dfbd43;
  border-radius: 9px;
  background: #fffdf3;
}
.company-match-review-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.company-match-review-heading h4 { margin: 3px 0; font-size: 15px; }
.company-match-review-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.company-match-candidates { margin: 9px 0; color: #6b5000; font-size: 11px; }
.company-match-resolution {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 9px;
}
.company-settings-main { margin-top: 0; }
.company-merge-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
}
.empty-table.compact { padding: 18px; }
@media (max-width: 900px) {
  .company-match-resolution,
  .company-merge-form { grid-template-columns: 1fr; }
  .company-match-review-heading { flex-direction: column; }
}

/* v0.7.11 planner display controls, shared trainer rows and company billing */
.planner-display-settings {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: #f8fafc;
}
.planner-display-settings.compact { max-width: 760px; }
.planner-display-settings .settings-section-heading { margin: 0 0 14px; }
.planner-display-settings .settings-section-heading h3,
.company-form-section legend { margin: 3px 0 4px; color: var(--ink); font-size: 17px; font-weight: 900; }
.planner-display-settings h4 { margin: 0 0 8px; font-size: 14px; }
.planner-display-grid {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.1fr);
  gap: 16px;
  align-items: start;
}
.planner-order-list,
.trainer-group-list { display: grid; gap: 8px; }
.planner-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
}
.planner-order-row.grouped { border-left: 5px solid #487aa9; background: #f5f9fd; }
.planner-order-row > div:first-child { min-width: 0; }
.planner-order-row strong,
.planner-order-row small { display: block; overflow-wrap: anywhere; }
.planner-order-row small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.planner-order-actions { display: inline-flex; flex: 0 0 auto; gap: 4px; }
.trainer-group-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 12px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
}
.trainer-group-card.inactive { opacity: .68; background: #f2f4f7; }
.trainer-group-card > div:first-child strong,
.trainer-group-card > div:first-child span { display: block; }
.trainer-group-card > div:first-child span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.trainer-group-members { grid-column: 1 / -1; display: grid; gap: 5px; }
.trainer-group-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: #f6f8fa;
  font-size: 12px;
}
.trainer-group-form {
  display: grid;
  gap: 10px;
  margin-top: 11px;
  padding: 12px;
  border: 1px dashed #aebdcd;
  border-radius: 9px;
  background: #fff;
}
.trainer-group-form .footer-actions { margin-top: 0; }

.weekly-comment-stack {
  display: grid;
  gap: 7px;
  height: 100%;
  min-height: 0;
}
.weekly-comment-entry {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 3px;
  min-height: 0;
}
.weekly-comment-entry > span {
  color: #475467;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
}
.weekly-comment-stack.grouped {
  grid-auto-rows: minmax(72px, 1fr);
  overflow: auto;
  padding-right: 2px;
}
.weekly-comment-stack.grouped .weekly-comment-input {
  height: 100%;
  min-height: 56px;
  padding: 6px 7px;
  font-size: 11px;
}

.company-details-form { max-height: 82vh; overflow: auto; }
.company-form-section {
  min-width: 0;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #fbfcfd;
}
.company-form-section + .company-form-section { margin-top: 12px; }
.company-form-section legend { padding: 0 6px; font-size: 14px; }
.company-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.company-form-grid .span-2 { grid-column: 1 / -1; }
.invoice-details-section { border-left: 5px solid #487aa9; background: #f6faff; }
.company-details-difference {
  margin-top: 11px;
  padding: 10px 11px;
  border: 1px solid #e0b84e;
  border-radius: 8px;
  background: #fff9df;
}
.company-details-difference summary { cursor: pointer; color: #624900; font-weight: 900; }
.company-details-difference-list { display: grid; gap: 7px; margin: 10px 0; }
.company-details-difference-list > div {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(185, 143, 29, .28);
  border-radius: 7px;
  background: rgba(255,255,255,.72);
}
.company-details-difference-list span { white-space: pre-line; overflow-wrap: anywhere; color: #475467; font-size: 11px; }
.company-details-difference > small { color: #6b5000; }

@media (max-width: 1050px) {
  .planner-display-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .planner-display-settings { padding: 12px; }
  .company-form-grid { grid-template-columns: 1fr; }
  .company-form-grid .span-2 { grid-column: auto; }
  .company-details-difference-list > div { grid-template-columns: 1fr; }
  .trainer-group-card { grid-template-columns: 1fr; }
  .trainer-group-card > .button { justify-self: start; }
}
