:root {
  --danger-text: #b42318;

  --font-sans: 'Segoe UI', 'Inter', 'Helvetica Neue', sans-serif;
  --text-size-body: 0.94rem;
  --text-size-sm: 0.88rem;
  --text-size-h1: 1.68rem;
  --text-size-h2: 1.2rem;
  --text-size-h3: 1rem;
  --line-height-body: 1.5;
  --line-height-tight: 1.3;
  --line-height-compact: 1.2;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --bg: #f2f7ff;
  --surface: #ffffff;
  --surface-muted: #e8f0fe;
  --border: #c6dafc;
  --text: #12335a;
  --muted: #4a6791;
  --accent: #1a73e8;
  --accent-strong: #0b57d0;
  --accent-hover: #1967d2;
  --accent-active: #174ea6;
  --accent-soft: rgba(26, 115, 232, 0.2);
  --accent-soft-2: rgba(52, 168, 83, 0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 3px 10px rgba(27, 44, 63, 0.1);
  --shadow-md: 0 12px 28px rgba(27, 44, 63, 0.16);
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-size-body);
  font-weight: var(--weight-regular);
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 100% 0%, rgba(26, 115, 232, 0.22) 0%, transparent 42%),
    radial-gradient(circle at 0% 100%, rgba(52, 168, 83, 0.16) 0%, transparent 38%),
    var(--bg);
  line-height: var(--line-height-body);
}

body.dark {
  --danger-text: #ffb4ab;

  --bg: #0d1724;
  --surface: #17283c;
  --surface-muted: #21344d;
  --border: #355578;
  --text: #e6f1ff;
  --muted: #aac0db;
  --accent: #8ab4f8;
  --accent-strong: #669df6;
  --accent-hover: #a8c7fa;
  --accent-active: #7baaf7;
  --accent-soft: rgba(138, 180, 248, 0.28);
  --accent-soft-2: rgba(129, 201, 149, 0.24);
  --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.55);
  --shadow-md: 0 8px 20px rgba(2, 6, 23, 0.45);
  color: var(--text);
  background:
    radial-gradient(circle at 100% 0%, rgba(138, 180, 248, 0.24) 0%, transparent 44%),
    radial-gradient(circle at 0% 100%, rgba(129, 201, 149, 0.2) 0%, transparent 38%),
    var(--bg);
}

* {
  box-sizing: border-box;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: var(--font-sans);
  font-size: var(--text-size-body);
  line-height: var(--line-height-tight);
  font-weight: var(--weight-regular);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: var(--text-size-h1);
  line-height: var(--line-height-compact);
  font-weight: var(--weight-semibold);
}

h2 {
  font-size: var(--text-size-h2);
  line-height: var(--line-height-tight);
  font-weight: var(--weight-semibold);
}

h3 {
  font-size: var(--text-size-h3);
  line-height: var(--line-height-tight);
  font-weight: var(--weight-medium);
}

label {
  font-size: var(--text-size-sm);
  line-height: var(--line-height-tight);
  font-weight: var(--weight-medium);
}

p,
li,
td,
.field,
.hint {
  line-height: var(--line-height-body);
}

.shell {
  display: grid;
  grid-template-columns: var(--vt-shell-sidebar-width, 260px) 1fr;
  min-height: 100vh;
  position: relative;
  transition: grid-template-columns 240ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: grid-template-columns;
}

@media (min-width: 961px) {
  html.vt-sidebar-collapsed .shell {
    --vt-shell-sidebar-width: 76px;
  }

  /* Mirror the collapsed-state rules below using the early <html> class so the
     sidebar renders in its final collapsed shape on first paint, before the
     shell/JS classes are applied, avoiding a flash of the expanded layout. */
  html.vt-sidebar-collapsed .shell,
  html.vt-sidebar-collapsed .brand,
  html.vt-sidebar-collapsed .sidebar nav a,
  html.vt-sidebar-collapsed .sidebar .theme-toggle,
  html.vt-sidebar-collapsed .sidebar #logout {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  html.vt-sidebar-collapsed .brand {
    font-size: 0;
  }

  html.vt-sidebar-collapsed .brand::before {
    content: 'VT';
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--accent);
  }

  html.vt-sidebar-collapsed .sidebar nav a {
    justify-content: center;
    min-height: 38px;
    padding: 8px;
  }

  html.vt-sidebar-collapsed .sidebar .sidebar-link-text {
    width: 0;
    opacity: 0;
    overflow: hidden;
  }

  html.vt-sidebar-collapsed .sidebar .theme-toggle,
  html.vt-sidebar-collapsed .sidebar #logout {
    justify-content: center;
    min-height: 36px;
  }

  html.vt-sidebar-collapsed .sidebar .sidebar-footer-btn .sidebar-link-text {
    width: 0;
    opacity: 0;
    overflow: hidden;
  }
}

html.vt-sidebar-preload .shell,
html.vt-sidebar-preload .sidebar {
  transition: none !important;
}

.shell.sidebar-collapsed {
  grid-template-columns: 76px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, #edf4ff 0%, #dbe9ff 100%);
  border-right: 1px solid var(--border);
  color: var(--text);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.sidebar .theme-toggle,
.sidebar #logout {
  width: 100%;
  justify-content: center;
}

.sidebar .sidebar-footer-btn {
  width: 100%;
}

.brand {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  padding: 6px 10px;
}

.sidebar nav {
  display: grid;
  gap: 4px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: #2a4867;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 160ms ease, color 160ms ease;
}

.sidebar-link-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-link-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.sidebar-link-text {
  min-width: 0;
}

.sidebar nav a.active,
.sidebar nav a:hover {
  background: var(--accent-soft);
  color: #1f3d61;
}

.shell.sidebar-collapsed .brand,
.shell.sidebar-collapsed .sidebar nav a,
.shell.sidebar-collapsed .sidebar .theme-toggle,
.shell.sidebar-collapsed .sidebar #logout {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.shell.sidebar-collapsed .brand {
  font-size: 0;
}

.shell.sidebar-collapsed .brand::before {
  content: 'VT';
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
}

.shell.sidebar-collapsed .sidebar nav a {
  justify-content: center;
  min-height: 38px;
  padding: 8px;
}

.shell.sidebar-collapsed .sidebar .sidebar-link-text {
  width: 0;
  opacity: 0;
  overflow: hidden;
}

.shell.sidebar-collapsed .sidebar .theme-toggle,
.shell.sidebar-collapsed .sidebar #logout {
  justify-content: center;
  min-height: 36px;
}

.shell.sidebar-collapsed .sidebar .sidebar-footer-btn .sidebar-link-text {
  width: 0;
  opacity: 0;
  overflow: hidden;
}

.content {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: transparent;
  min-width: 0;
}

body.dark .content {
  background: transparent;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 4px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.header-actions,
.actions,
.toolbar {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.card,
.panel,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-md);
}

body.dark .card,
body.dark .panel,
body.dark .stat-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
}

body.dark .system-card,
body.dark .field-settings-item,
body.dark .subject-row,
body.dark .subject-modal-card,
body.dark .auth-card,
body.dark .holiday-modal-card,
body.dark .event-details-card,
body.dark .modal-card,
body.dark .toolbar,
body.dark .calendar-legend,
body.dark #calendar,
body.dark #holidayCalendar,
body.dark .search-page .event-details-card {
  background: linear-gradient(180deg, #1a2d43 0%, #16273a 100%);
  border-color: #355578;
  color: var(--text);
}

body.dark .sidebar {
  background: linear-gradient(180deg, #1a2f46 0%, #16263a 100%);
  border-right-color: var(--border);
}

body.dark .sidebar nav a {
  color: #d8e8fb;
}

body.dark .sidebar nav a.active,
body.dark .sidebar nav a:hover {
  background: var(--accent-soft);
  color: #f2f8ff;
}

body.dark .field,
body.dark textarea.field,
body.dark select.field {
  background: #0f172a;
  color: #f8fafc;
}

body.dark .btn.secondary {
  background: #1f2937;
  color: #e2e8f0;
}

body.dark .modal-backdrop,
body.dark .event-details-backdrop {
  background: rgba(2, 6, 23, 0.72);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card p {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 8px;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  gap: var(--space-2);
}

.list {
  display: grid;
  gap: var(--space-2);
}

.list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 8px 0;
  border-bottom: 1px solid #e2e7ec;
}

body.dark .list li {
  border-color: #334155;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease, border-color 160ms ease, transform 120ms ease;
  line-height: var(--line-height-tight);
  font-size: var(--text-size-sm);
  font-weight: var(--weight-medium);
}

.btn:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  background: var(--accent-active);
  transform: translateY(1px);
}

.btn.secondary {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
  color: #27415f;
  border-color: var(--border);
}

.btn.secondary:hover {
  background: var(--surface-muted);
}

.btn.secondary:active {
  background: #e1edf9;
}

body.dark .btn.secondary {
  background: #1f2937;
  color: #e2e8f0;
}

.field {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfdff;
  width: 100%;
  min-height: 36px;
  color: var(--text);
  font-size: var(--text-size-body);
}

body.dark .field {
  background: #0f172a;
  border-color: #475569;
  color: #f8fafc;
}

body.dark .data-table th,
body.dark .data-table td,
body.dark .holiday-summary-table th,
body.dark .holiday-summary-table td {
  background: #111827;
  border-color: #334155;
  color: #e2e8f0;
}

textarea.field {
  min-height: 100px;
  resize: vertical;
}

.hint {
  color: #64717f;
  font-size: .9rem;
}

body.dark .hint {
  color: #94a3b8;
}

.stack {
  display: grid;
  gap: var(--space-3);
}

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid #f1f5f9;
}

body.dark .card-row {
  border-color: #334155;
}

.toolbar {
  justify-content: space-between;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #3d4b59;
}

.icon-btn:hover {
  background: var(--surface-muted);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.sidebar-floating-toggle {
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .sidebar-floating-toggle {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .compact-toolbar {
    row-gap: 8px;
    padding: 8px;
  }

  .toolbar-left,
  .toolbar-right {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .toolbar-center {
    order: -1;
    width: 100%;
    justify-content: center;
  }

  .view-toggle {
    flex: 1 1 auto;
    justify-content: center;
  }

  .search-expand {
    flex: 1 1 150px;
    width: auto;
    min-width: 0;
  }

  .search-expand.is-open .search-expand-input {
    width: min(100%, 260px);
  }

  .legend-edit-btn {
    margin-left: 0;
  }

  .calendar-legend {
    gap: 8px 10px;
  }

  .legend-chip {
    white-space: normal;
  }
}

.compact-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #eaf1ff 100%);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  max-width: 100%;
}

.toolbar-center {
  flex: 1 1 160px;
  justify-content: center;
}

.toolbar-right {
  justify-content: flex-end;
  margin-left: auto;
}

.toolbar-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: #204768;
  white-space: nowrap;
}

body.dark .compact-toolbar {
  background: linear-gradient(180deg, #1a2d43 0%, #16273a 100%);
  border-color: #355578;
}

body.dark .toolbar-title {
  color: #e6f1ff;
}

body.dark .icon-btn {
  color: #cfe0f2;
}

.sidebar-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.sidebar #verhoefWebsiteBtn.sidebar-footer-btn {
  justify-content: center;
}

.view-toggle {
  display: inline-flex;
  gap: 6px;
  background: transparent;
}

.view-toggle .btn {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #f0f6ff 0%, #dce9ff 100%);
  color: #174ea6;
  box-shadow: none;
}

.view-toggle .btn.is-active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 5px 14px rgba(26, 115, 232, 0.28);
}

body.dark .view-toggle .btn {
  background: linear-gradient(180deg, #23456f 0%, #1d3a5b 100%);
  color: #e2efff;
  border-color: #5f89ba;
}

body.dark .view-toggle .btn.is-active {
  background: linear-gradient(135deg, #8ab4f8 0%, #669df6 100%);
  color: #112a45;
}

.search-expand {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  flex: 0 0 36px;
  overflow: visible;
}

.search-expand .icon-btn {
  position: relative;
  z-index: 2;
}

.search-expand .icon-btn svg {
  width: 18px;
  height: 18px;
}

.search-expand-input {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  min-height: 36px;
  opacity: 0;
  box-sizing: border-box;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  line-height: 36px;
  pointer-events: none;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: width 220ms cubic-bezier(0.2, 0, 0, 1), opacity 140ms ease, border-color 180ms ease, box-shadow 180ms ease, padding 220ms cubic-bezier(0.2, 0, 0, 1);
  will-change: width, opacity;
}

.search-expand-input::placeholder {
  color: var(--muted);
}

.search-expand.is-open .search-expand-input {
  width: clamp(210px, 28vw, 340px);
  opacity: 1;
  padding: 0 42px 0 12px;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}

.search-expand.is-open {
  z-index: 9;
}

.search-expand.is-open .icon-btn {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.search-expand.is-open .icon-btn:hover {
  background: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.field:not([type="checkbox"]):focus,
.field:not([type="checkbox"]):focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(95, 118, 144, 0.28);
}

body.dark .field:not([type="checkbox"]):focus,
body.dark .field:not([type="checkbox"]):focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(136, 160, 184, 0.32);
}

.theme-toggle {
  margin-top: 0;
}

.search-box {
  flex: 1;
}

.search-filters {
  margin-top: 12px;
}

.search-results {
  margin-top: 16px;
}

.search-modal-backdrop {
  display: none;
}

.labs-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.labs-filter .checkbox-inline {
  width: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-size-sm);
}

.table-shell {
  width: 100%;
  overflow-x: auto;
}

.data-table th,
.data-table td {
  border: 1px solid var(--border);
  padding: 8px;
  text-align: left;
}

.data-table th,
.holiday-summary-table th {
  background: var(--surface-muted);
}

.data-table th,
.holiday-summary-table th {
  font-size: var(--text-size-sm);
  line-height: var(--line-height-tight);
  font-weight: var(--weight-medium);
  color: #234361;
}

.data-table td,
.holiday-summary-table td {
  font-size: var(--text-size-sm);
  line-height: var(--line-height-body);
  font-weight: var(--weight-regular);
}

.data-table input {
  width: 100%;
  border: 1px solid #c9d1d9;
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--surface);
}

body.dark .data-table th,
body.dark .data-table td {
  background: #111827;
  border-color: #334155;
}

body.dark .data-table input {
  background: #0f172a;
  border-color: #475569;
  color: #f8fafc;
}

body.dark .data-table {
  color: #e2e8f0;
}

body.dark .subject-row,
body.dark .system-card,
body.dark .member-card,
body.dark .hub-card,
body.dark .holiday-summary,
body.dark .panel,
body.dark .card {
  color: #e2e8f0;
}

body.dark .theme-toggle {
  background: #111827;
  border-color: #475569;
  color: #e2e8f0;
}

body.dark .sidebar-link-icon,
body.dark .sidebar-footer-btn .sidebar-link-icon {
  color: #cbd5e1;
}

.form-card {
  display: grid;
  gap: var(--space-4);
}

.form-row {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row .full {
  grid-column: 1 / -1;
}

.calendar-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.calendar-stats {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.calendar-pill {
  background: linear-gradient(135deg, #edf4ff 0%, #dbe9ff 100%);
  color: #15468c;
  border: 1px solid #bdd3f8;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.95rem;
}

body.dark .calendar-pill {
  background: linear-gradient(135deg, #243140 0%, #17202a 100%);
  color: #d9e2eb;
  border-color: #3b4a5a;
}

.calendar-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #35577b;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(128, 162, 201, 0.2);
  border-radius: 999px;
  padding: 4px 8px;
}

.legend-edit-btn {
  margin-left: auto;
  min-height: 32px;
  padding: 6px 10px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.confirmed {
  background: #1a73e8;
}

.legend-dot.pending {
  background: #fbbc04;
}

.legend-dot.cancelled {
  background: #ea4335;
}

.legend-dot.other {
  background: #34a853;
}

.legend-dot.complete {
  background: #34a853;
}

.hidden {
  display: none !important;
}

.page-status {
  display: none;
  margin-top: 10px;
  color: var(--danger-text);
  font-size: 0.95rem;
}


.checkbox-inline {
  margin-top: 8px;
  display: block;
}

.event-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 0;
}

.event-details-title {
  margin: 0;
}

body.dark .legend-chip {
  color: #cbd5e1;
}

.fc-toolbar-title {
  font-size: 1.1rem !important;
  line-height: var(--line-height-tight);
  font-weight: var(--weight-medium);
  color: #234a6e;
}

.fc,
.fc * {
  font-family: var(--font-sans);
}

.fc-col-header-cell-cushion,
.fc-daygrid-day-number,
.fc-timegrid-axis-cushion,
.fc-timegrid-slot-label-cushion,
.fc-list-event-title {
  font-size: var(--text-size-sm);
  line-height: var(--line-height-tight);
}

.fc-button {
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%) !important;
  color: #274766 !important;
  box-shadow: none !important;
  text-transform: none !important;
  font-weight: 500 !important;
}

.fc-button:hover,
.fc-button:focus {
  background: var(--accent-soft) !important;
}

.fc-event {
  border-radius: 12px !important;
  border: 0 !important;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.fc-daygrid-day-frame,
.fc-timegrid-slot,
.fc-scrollgrid-section {
  border-radius: 10px;
}

.fc-daygrid-day-number,
.fc-col-header-cell-cushion {
  color: #4d5c6a;
}

body.dark .fc-daygrid-day-frame {
  background: #16273a;
  border-color: #355578;
}

body.dark .fc-daygrid-day:hover .fc-daygrid-day-frame {
  background: #1c324b;
}

body.dark .fc-day-today .fc-daygrid-day-frame {
  background: linear-gradient(135deg, #28476b 0%, #1a2d43 100%);
  border-color: #4b76a6;
}

body.dark .fc-daygrid-day-number,
body.dark .fc-col-header-cell-cushion {
  color: #cbd5e1;
}

body.dark .fc-scrollgrid,
body.dark .fc-scrollgrid-section,
body.dark .fc-scrollgrid-section-header,
body.dark .fc-scrollgrid-section-body,
body.dark .fc-scrollgrid-sync-table,
body.dark .fc-list-table,
body.dark .fc-popover {
  background: #16273a;
  border-color: #355578;
  color: var(--text);
}

body.dark .fc-col-header-cell,
body.dark .fc-list-day-cushion,
body.dark .fc-list-day-text,
body.dark .fc-list-day-side-text {
  background: #1b3047;
  color: var(--text);
  border-color: #355578;
}

body.dark .fc-list-table td {
  border-color: #355578;
}

body.dark .fc-list-event:hover td {
  background: #172554;
}

body.dark .fc .fc-button,
body.dark .fc-button,
body.dark .fc-theme-standard td,
body.dark .fc-theme-standard th,
body.dark .fc-theme-standard .fc-scrollgrid,
body.dark .fc-theme-standard .fc-scrollgrid-section>td,
body.dark .fc-theme-standard .fc-scrollgrid-section>th,
body.dark .fc .fc-timegrid-slot,
body.dark .fc .fc-timegrid-axis {
  background: #16273a !important;
  border-color: #355578 !important;
  color: var(--text) !important;
}

/* Overrides per-page inline <style> blocks that hardcode light colours for the
   FullCalendar toolbar (calendar.html/holidays.html). Pages that already define
   their own body.dark .fc-toolbar-title / .fc-button-group rules take
   precedence via normal cascade order (no !important here). */
body.dark .fc-toolbar-title {
  color: var(--text);
}

body.dark .fc .fc-button-group {
  background: var(--surface-muted);
  border-color: var(--border);
}

.members-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Members page: keep profile cards roomy and predictable as the page narrows. */
@media (max-width: 1200px) {
  .members-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .members-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hub-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
  border: 1px solid #cfe0f2;
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef5fd 100%);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

body.dark .hub-card {
  background: linear-gradient(135deg, #17202a 0%, #243140 100%);
  border-color: #3b4a5a;
}

.systems-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.system-card {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid #d8dfe6;
  display: grid;
  gap: 12px;
  background: var(--surface);
}

.system-inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.system-edit-form {
  display: grid;
  gap: 10px;
}

.system-card.is-on {
  border-color: #83a894;
  box-shadow: inset 0 0 0 1px rgba(131, 168, 148, 0.24);
}

.system-card.is-off {
  border-color: #c89995;
  box-shadow: inset 0 0 0 1px rgba(200, 153, 149, 0.24);
}

body.dark .system-card {
  background: #111827;
  border-color: #334155;
}

.system-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.system-status {
  font-weight: 700;
  color: #64748b;
  font-size: 0.9rem;
}

.system-card.is-on .system-status {
  color: #4f7a60;
}

.system-card.is-off .system-status {
  color: #8a4c47;
}

.system-notes {
  color: #64748b;
  font-size: 0.95rem;
}

body.dark .system-notes,
body.dark .empty-state,
body.dark .system-status {
  color: #cbd5e1;
}

.system-form-card,
.systems-notes-card {
  display: grid;
  gap: 12px;
}

.empty-state {
  text-align: center;
  color: #64748b;
}

.member-card {
  border: 1px solid #cfe0f2;
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(135deg, #f8fbff 0%, #edf5fd 100%);
  display: flex;
  gap: 12px;
  align-items: center;
}

body.dark .member-card {
  background: linear-gradient(135deg, #17202a 0%, #243140 100%);
  border-color: #3b4a5a;
}

.dashboard-date-card {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
}

.dashboard-date-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.dashboard-date-meta {
  font-size: 0.95rem;
  color: #64748b;
}

body.dark .dashboard-date-meta {
  color: #94a3b8;
}

.member-form-card {
  margin-bottom: 16px;
}

.add-instructor-panel {
  max-width: 560px;
  margin-top: 24px;
}

.add-instructor-active {
  width: auto;
}

.event-result-card {
  border-radius: 14px;
  border: 1px solid #cfe0f2;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7fd 100%);
  display: grid;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.event-result-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--event-color, #5f7690);
}

.event-result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-left: 8px;
}

.event-result-meta,
.event-result-notes {
  color: #64748b;
  padding-left: 8px;
}

.archive-badge {
  font-size: 0.78rem;
  color: #7b6038;
  background: #f5efdf;
  border: 1px solid #dccaa7;
  border-radius: 999px;
  padding: 2px 8px;
}

.detail-list.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-list.two-column .detail-row {
  border: 1px solid #d8dfe6;
  border-radius: 10px;
  padding: 12px;
  grid-template-columns: 1fr;
  gap: 6px;
}

.detail-list.two-column .detail-row strong {
  color: #2d3d4f;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-list.two-column .detail-row span {
  color: #5a6979;
}

.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.category-tab {
  border: 1px solid #c6dafc;
  border-radius: 999px;
  background: #eef4ff;
  color: #24456a;
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.category-tab.is-active {
  background: linear-gradient(135deg, #1a73e8 0%, #0b57d0 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(26, 115, 232, 0.28);
}

.category-empty {
  border: 1px dashed #c6dafc;
  border-radius: 10px;
  padding: 12px;
  background: #f7fbff;
  color: #496585;
  font-size: 0.9rem;
}

body.dark .event-result-card {
  background: #111827;
  border-color: #334155;
}

body.dark .event-result-meta,
body.dark .event-result-notes {
  color: #cbd5e1;
}

body.dark .archive-badge {
  color: #e0c898;
  background: #3a3427;
  border-color: #7b6038;
}

body.dark .detail-list.two-column .detail-row {
  border-color: #334155;
  background: #0f172a;
}

body.dark .detail-list.two-column .detail-row strong,
body.dark .detail-list.two-column .detail-row span {
  color: #e2e8f0;
}

body.dark .category-tab {
  background: #1d3550;
  border-color: #45658d;
  color: #dbeafe;
}

body.dark .category-tab.is-active {
  background: linear-gradient(135deg, #7eb3f0 0%, #5f95d7 100%);
  color: #0f2136;
}

body.dark .category-empty {
  background: #0f1f33;
  border-color: #3f5d84;
  color: #c7d7eb;
}

body.calendar-page .content {
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 12px;
}

body.calendar-page .page-header {
  margin-bottom: 0;
}

.member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f74cc 0%, #26b89a 100%);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

@media (max-width: 900px) {

  .panel-grid,
  .form-row,
  .hub-grid,
  .systems-grid {
    grid-template-columns: 1fr;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 320px);
    z-index: 1200;
    transform: translateX(-100%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
    padding: 16px 14px;
    background: var(--surface);
    border-right: 1px solid var(--border);
  }

  .shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-overlay-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(32, 33, 36, 0.35);
    z-index: 1100;
  }

  .detail-list.two-column {
    grid-template-columns: 1fr;
  }

  .compact-toolbar {
    flex-wrap: wrap;
  }

  .toolbar-center {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .toolbar-right {
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .sidebar {
    width: min(88vw, 320px);
  }

  .search-expand.is-open .search-expand-input {
    width: clamp(170px, 52vw, 280px);
  }
}

/* Keep the internal tool compact and use square edges consistently. */
button,
input,
select,
textarea,
.card,
.panel,
.stat-card,
.modal-card,
.toolbar,
.compact-toolbar,
.calendar-legend,
.calendar-pill,
.category-tab,
.field-settings-item,
.search-field-panel,
.search-field-option,
.detail-row,
.event-result-card,
.fc-button,
.fc-event,
.fc-daygrid-day-frame,
.fc-scrollgrid,
.fc-scrollgrid-section,
.fc-daygrid-day,
.fc-timegrid-slot {
  border-radius: 0 !important;
}

body.calendar-page .toolbar {
  padding-top: 4px;
  padding-bottom: 4px;
}

body.calendar-page .toolbar .field {
  padding-top: 7px;
  padding-bottom: 7px;
}

body.calendar-page .calendar-legend {
  padding-top: 6px;
  padding-bottom: 6px;
}

/* All application surfaces use straight edges. */
*,
*::before,
*::after {
  border-radius: 0 !important;
}

body.calendar-page .calendar-shell {
  gap: var(--space-2);
  grid-template-rows: 48px 34px minmax(0, 1fr);
  min-height: 0;
  height: calc(100vh - 24px);
}

body.calendar-page .calendar-toolbar {
  height: 48px !important;
  min-height: 48px !important;
  padding: 5px 8px;
  gap: var(--space-2);
  overflow-x: auto;
}

body.calendar-page .calendar-toolbar .icon-btn,
body.calendar-page .calendar-toolbar .btn {
  min-height: 34px;
  padding-top: 7px;
  padding-bottom: 7px;
}

body.calendar-page .calendar-legend {
  height: 34px !important;
  min-height: 34px !important;
  padding: 6px 10px;
  gap: var(--space-2);
  align-items: center;
  overflow-x: auto;
  margin: 0 !important;
}

body.calendar-page .legend-chip {
  gap: 5px;
  line-height: 1.1;
  height: auto !important;
  align-self: center;
  white-space: nowrap;
}

body.calendar-page .fc-timeGridWeek-view,
body.calendar-page .fc-timeGridDay-view,
body.calendar-page .fc-timeGridWeek-view .fc-scrollgrid,
body.calendar-page .fc-timeGridDay-view .fc-scrollgrid,
body.calendar-page .fc-timeGridWeek-view .fc-scrollgrid-section-body,
body.calendar-page .fc-timeGridDay-view .fc-scrollgrid-section-body {
  height: 100%;
  min-height: 0;
}

body.calendar-page .fc-timeGridWeek-view .fc-scroller-harness,
body.calendar-page .fc-timeGridDay-view .fc-scroller-harness,
body.calendar-page .fc-timeGridWeek-view .fc-scroller,
body.calendar-page .fc-timeGridDay-view .fc-scroller {
  min-height: 0;
  overflow: auto !important;
}

body.calendar-page .fc-timeGridWeek-view .fc-scrollgrid,
body.calendar-page .fc-timeGridDay-view .fc-scrollgrid {
  position: absolute;
  inset: 0;
  display: block;
  height: 100% !important;
  width: 100%;
}

body.calendar-page .fc-timeGridWeek-view .fc-scrollgrid-section-liquid,
body.calendar-page .fc-timeGridDay-view .fc-scrollgrid-section-liquid {
  height: calc(100% - 30px) !important;
}

body.calendar-page .fc-timeGridWeek-view .fc-scrollgrid-section-liquid>td,
body.calendar-page .fc-timeGridDay-view .fc-scrollgrid-section-liquid>td {
  height: 100% !important;
}

body.calendar-page .fc-timeGridWeek-view .fc-timegrid-body,
body.calendar-page .fc-timeGridDay-view .fc-timegrid-body {
  min-height: 100%;
}
/* ========================================================================== 
   Final UI polish — scoped, low-risk consistency improvements
   ========================================================================== */

:root {
  --radius-sm: 7px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-sm: 0 2px 8px rgba(31, 55, 86, 0.10);
  --shadow-md: 0 8px 22px rgba(31, 55, 86, 0.12);
}

body {
  background:
    linear-gradient(180deg, rgba(26, 115, 232, 0.035), transparent 180px),
    var(--bg);
}

body.dark {
  background:
    linear-gradient(180deg, rgba(138, 180, 248, 0.045), transparent 200px),
    var(--bg);
}

.card,
.panel,
.stat-card,
.system-card,
.member-card,
.event-result-card {
  box-shadow: var(--shadow-sm);
}

.btn,
.icon-btn,
.field,
textarea.field,
select.field {
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease, transform 120ms ease;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.field:focus-visible,
a:focus-visible,
.category-tab:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}

.field:focus,
textarea.field:focus,
select.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.sidebar {
  box-shadow: 8px 0 26px rgba(33, 61, 95, 0.045);
}

.sidebar nav a {
  position: relative;
}

.sidebar nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.sidebar .sidebar-footer-btn {
  min-height: 38px;
  justify-content: flex-start;
}

.sidebar #verhoefWebsiteBtn.sidebar-footer-btn {
  justify-content: flex-start;
}

.category-tabs,
.category-tabs-wrap {
  min-height: 36px;
  align-items: center;
}

.category-tab {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  line-height: 1.15;
}

/* Keep modal navigation stationary while only the active category content changes. */
.modal-backdrop,
.event-details-backdrop,
.search-page .event-details-backdrop {
  overflow-y: auto;
  padding-top: max(16px, 4vh);
  padding-bottom: max(16px, 4vh);
}

.modal-card,
.event-details-card,
.search-page .event-details-card {
  margin: 0 auto;
  border-radius: 12px;
}

.modal-card .category-tabs,
.event-details-card .category-tabs,
.search-page .event-details-card .category-tabs {
  flex: 0 0 auto;
}

/* Protected system dates remain visible but are clearly non-editable. */
.field-settings-item.is-protected {
  cursor: default;
  background: color-mix(in srgb, var(--surface-muted) 58%, var(--surface));
}

.protected-field-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.field-settings-item button:disabled,
.field-settings-item select:disabled,
.field-settings-item input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

/* Search keeps archived as a search option, not as a configurable event field. */
.search-field-controls {
  align-items: center;
  gap: 10px;
}

.search-archive-toggle {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  color: var(--muted);
}

.search-page #customFilters:empty {
  display: none;
}

.search-page .search-field-option {
  min-height: 34px;
}

/* Dashboard navigation is intentionally card-like rather than a grid of buttons. */
.dashboard-page .hub-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.dashboard-page .hub-card {
  position: relative;
  min-height: 164px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 18px 18px 16px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(31, 55, 86, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.dashboard-page .hub-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
  opacity: 0.72;
}

.dashboard-page .hub-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  box-shadow: 0 10px 24px rgba(31, 55, 86, 0.13);
  background: color-mix(in srgb, var(--surface) 93%, var(--surface-muted));
}

.dashboard-page .hub-card h3 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 7px;
}

.dashboard-page .hub-card .hint {
  max-width: 36ch;
}

.dashboard-page .hub-card-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin-top: 16px;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 650;
}

.dashboard-page .hub-card:hover .hub-card-action span {
  transform: translateX(3px);
}

.dashboard-page .hub-card-action span {
  transition: transform 150ms ease;
}

body.dark.dashboard-page .hub-card {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 5px 18px rgba(2, 6, 23, 0.24);
}

body.dark.dashboard-page .hub-card:hover {
  background: color-mix(in srgb, var(--surface) 90%, var(--surface-muted));
}

@media (max-width: 720px) {
  .content {
    padding: 12px;
  }

  .compact-toolbar {
    gap: 8px;
  }

  .panel-grid,
  .form-row,
  .detail-list.two-column {
    grid-template-columns: 1fr;
  }

  .search-field-controls {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .search-archive-toggle {
    width: 100%;
  }

  .search-page .search-field-panel {
    left: 0;
    right: 0;
    width: 100%;
  }

  .dashboard-page .hub-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-page .hub-card {
    min-height: 142px;
  }
}

/* ==========================================================================\n   FRIENDLY PROFESSIONAL THEME — SEPTEMBER 2026\n   Google Calendar-inspired clarity with Verhoef Training's own identity.\n   These final overrides intentionally keep existing markup and behaviour while\n   giving every page one consistent, modern visual system.\n   ========================================================================== */

:root {
  --font-sans: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-muted: #f3f6fb;
  --surface-raised: #ffffff;
  --border: #dde3ec;
  --border-strong: #c9d2df;
  --text: #1f2937;
  --muted: #667085;
  --accent: #1a73e8;
  --accent-strong: #0b57d0;
  --accent-hover: #155fc0;
  --accent-active: #0b4cb8;
  --accent-soft: rgba(26, 115, 232, 0.12);
  --accent-soft-2: rgba(52, 168, 83, 0.12);
  --positive: #188038;
  --warning: #b06000;
  --danger: #c5221f;
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 12px 32px rgba(16, 24, 40, 0.10);
}

body.dark {
  --bg: #101419;
  --surface: #191f26;
  --surface-muted: #222a33;
  --surface-raised: #1e252d;
  --border: #303a45;
  --border-strong: #43505d;
  --text: #f0f4f8;
  --muted: #a7b2bf;
  --accent: #8ab4f8;
  --accent-strong: #aecbfa;
  --accent-hover: #a8c7fa;
  --accent-active: #c2d7fa;
  --accent-soft: rgba(138, 180, 248, 0.15);
  --accent-soft-2: rgba(129, 201, 149, 0.13);
  --positive: #81c995;
  --warning: #fdd663;
  --danger: #f28b82;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18), 0 6px 18px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 18px 42px rgba(0, 0, 0, 0.34);
}

html,
body {
  min-height: 100%;
}

body,
body.dark {
  background: var(--bg);
  color: var(--text);
}

body {
  letter-spacing: -0.005em;
}

.shell {
  --vt-shell-sidebar-width: 248px;
  background: var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 14px 12px 16px;
  gap: 10px;
  background: #f3f6fb;
  border-right: 1px solid var(--border);
  box-shadow: none;
}

body.dark .sidebar {
  background: #151a20;
  border-right-color: var(--border);
}

.brand {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand::after {
  content: '';
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 50%;
  background: #34a853;
  box-shadow: 0 0 0 3px rgba(52, 168, 83, 0.10);
}

.sidebar nav {
  gap: 3px;
}

.sidebar nav a {
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #4b5565;
  font-size: 0.91rem;
  font-weight: 520;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

body.dark .sidebar nav a {
  color: #bdc7d2;
}

.sidebar nav a:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.sidebar nav a.active {
  color: #0b57d0;
  background: #dfeaff;
  font-weight: 650;
}

body.dark .sidebar nav a.active {
  color: #d2e3fc;
  background: rgba(138, 180, 248, 0.16);
}

.sidebar nav a.active::before {
  display: none;
}

.sidebar-link-icon {
  width: 19px;
  height: 19px;
  flex-basis: 19px;
  opacity: 0.88;
}

.sidebar nav a.active .sidebar-link-icon {
  opacity: 1;
}

.sidebar .sidebar-footer-btn,
.sidebar #logout,
.sidebar .theme-toggle {
  min-height: 40px;
  border-radius: 10px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.sidebar .sidebar-footer-btn:hover,
.sidebar #logout:hover,
.sidebar .theme-toggle:hover {
  color: var(--text);
  background: var(--surface-muted);
  border-color: transparent;
}

.content {
  min-width: 0;
  padding: 18px 22px 28px;
  background: var(--bg);
}

.compact-toolbar {
  min-height: 62px;
  margin: -2px 0 16px;
  padding: 8px 2px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.toolbar-title {
  color: var(--text);
  font-size: clamp(1.18rem, 2vw, 1.48rem);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.icon-btn {
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--surface-muted);
  border-color: transparent;
}

.card,
.panel,
.stat-card,
.system-card,
.member-card,
.event-result-card,
.field-settings-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

body.dark .card,
body.dark .panel,
body.dark .stat-card,
body.dark .system-card,
body.dark .member-card,
body.dark .event-result-card,
body.dark .field-settings-item {
  background: var(--surface);
  border-color: var(--border);
}

.card,
.panel {
  padding: 18px;
}

.panel-header,
.card-header {
  padding-bottom: 12px;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hint,
.event-result-meta,
.event-details-meta {
  color: var(--muted);
}

.btn {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid #1a73e8;
  border-radius: 9px;
  background: #1a73e8;
  color: #fff;
  font-weight: 620;
  box-shadow: none;
  cursor: pointer;
}

.btn:hover {
  background: #1765cc;
  border-color: #1765cc;
  box-shadow: 0 2px 7px rgba(26, 115, 232, 0.18);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn.secondary {
  color: #465467;
  border-color: var(--border-strong);
  background: var(--surface);
  box-shadow: none;
}

.btn.secondary:hover {
  color: var(--accent-strong);
  border-color: #a8c7fa;
  background: #f5f9ff;
}

body.dark .btn.secondary {
  color: #d5dde6;
  border-color: var(--border-strong);
  background: var(--surface);
}

body.dark .btn.secondary:hover {
  color: #d2e3fc;
  border-color: #5f7794;
  background: #222b35;
}

.field,
textarea.field,
select.field {
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 11px;
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, 0.02);
}

.field::placeholder,
textarea.field::placeholder {
  color: #98a2b3;
}

.field:focus,
textarea.field:focus,
select.field:focus {
  border-color: #6ea8f7;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.11);
}

.category-tabs,
.category-tabs-wrap {
  min-height: 42px;
  gap: 5px;
  padding: 4px;
  border-radius: 11px;
  background: var(--surface-muted);
}

.category-tab {
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 590;
  box-shadow: none;
}

.category-tab:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.category-tab.active,
.category-tab.is-active {
  color: var(--accent-strong);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.10);
}

.modal-backdrop,
.event-details-backdrop,
.search-page .event-details-backdrop {
  background: rgba(31, 41, 55, 0.38);
  backdrop-filter: blur(3px);
}

.modal-card,
.event-details-card,
.search-page .event-details-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

body.dark .modal-card,
body.dark .event-details-card,
body.dark.search-page .event-details-card {
  background: var(--surface-raised);
  border-color: var(--border);
}

/* Search: compact filter chooser, stable remembered choices, richer result cards. */
.search-page .panel {
  max-width: 1180px;
  margin: 0 auto;
}

.search-page .toolbar {
  gap: 9px;
  align-items: center;
}

.search-page .search-box {
  min-height: 44px;
  border-radius: 22px;
  padding-left: 16px;
  background: var(--surface-muted);
  border-color: transparent;
}

.search-page .search-box:focus {
  background: var(--surface);
  border-color: #a8c7fa;
}

.search-page .search-field-controls {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}

.search-page .search-field-panel {
  top: 46px;
  width: min(390px, 92vw);
  max-height: min(55vh, 460px);
  padding: 8px;
  border-radius: 13px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
}

.search-page .search-field-option {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--text);
  cursor: pointer;
}

.search-page .search-field-option:hover {
  background: var(--accent-soft);
}

.search-results {
  margin-top: 16px;
  gap: 10px;
}

.event-result-card {
  position: relative;
  padding: 15px 16px 14px 19px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.event-result-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--event-color, var(--accent));
}

.event-result-card:hover {
  transform: translateY(-1px);
  border-color: #b9cce8;
  box-shadow: 0 7px 18px rgba(16, 24, 40, 0.08);
}

.event-result-title strong {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 680;
}

/* Dashboard: warm, useful launchpad rather than a wall of ordinary buttons. */
.dashboard-page .content {
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

.dashboard-page .card:first-of-type {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-color: #d7e3f5;
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 72%, #eef6ff 100%);
}

.dashboard-page .card:first-of-type::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -85px;
  border-radius: 50%;
  background: rgba(26, 115, 232, 0.08);
}

body.dark.dashboard-page .card:first-of-type {
  border-color: var(--border);
  background: linear-gradient(135deg, #1b222a 0%, #182331 100%);
}

.dashboard-page .hub-grid {
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 13px;
}

.dashboard-page .hub-card {
  min-height: 154px;
  padding: 18px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.dashboard-page .hub-card::before {
  inset: 18px auto 18px 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  opacity: 0.7;
}

.dashboard-page .hub-card:hover {
  transform: translateY(-2px);
  border-color: #bcd1ef;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.09);
}

.dashboard-page .hub-card h3 {
  color: var(--text);
  font-size: 1.03rem;
  font-weight: 680;
}

.dashboard-page .hub-card-action {
  color: var(--accent-strong);
}

/* FullCalendar: familiar Google Calendar-like spacing without cloning it. */
.calendar-page .calendar-card,
.holidays-page .calendar-card {
  border-radius: 14px;
  overflow: hidden;
}

.fc .fc-scrollgrid,
.fc-theme-standard td,
.fc-theme-standard th {
  border-color: var(--border) !important;
}

.fc .fc-col-header-cell {
  background: var(--surface-muted);
}

.fc .fc-col-header-cell-cushion {
  padding: 10px 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.fc .fc-daygrid-day-number {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 4px;
  padding: 0;
  border-radius: 50%;
  color: var(--text);
  font-size: 0.82rem;
}

.fc .fc-day-today .fc-daygrid-day-number {
  color: #fff;
  background: #1a73e8;
  font-weight: 700;
}

.fc .fc-day-today .fc-daygrid-day-frame {
  background: rgba(26, 115, 232, 0.035);
}

.fc .fc-daygrid-day:hover .fc-daygrid-day-frame {
  background: rgba(26, 115, 232, 0.025);
}

.fc .fc-event {
  border-radius: 5px;
  border-width: 0;
  padding: 1px 3px;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: none;
}

.fc .fc-event:hover {
  filter: brightness(0.98);
}

/* Tables and operational sheets */
table {
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 0.78rem;
  font-weight: 680;
  letter-spacing: 0.02em;
}

tbody tr:hover td {
  background: color-mix(in srgb, var(--accent-soft) 42%, transparent);
}

/* Login gets the same restrained, friendly identity. */
.auth-card {
  border-radius: 20px !important;
  border-color: var(--border) !important;
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.12) !important;
}

.logo-mark {
  border-radius: 14px !important;
  background: linear-gradient(135deg, #1a73e8, #34a853) !important;
  box-shadow: 0 7px 18px rgba(26, 115, 232, 0.18);
}

/* Responsive polish */
@media (max-width: 960px) {
  .content {
    padding: 14px 14px 24px;
  }

  .sidebar {
    position: fixed;
    z-index: 1000;
    width: min(286px, 84vw);
  }

  .compact-toolbar {
    min-height: 54px;
    margin-bottom: 10px;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 10px 10px 20px;
  }

  .card,
  .panel {
    padding: 14px;
    border-radius: 12px;
  }

  .btn {
    min-height: 40px;
  }

  .search-page .toolbar {
    align-items: stretch;
  }

  .search-page .search-box {
    width: 100%;
  }

  .dashboard-page .hub-grid {
    gap: 10px;
  }

  .dashboard-page .hub-card {
    min-height: 132px;
  }
}

.dashboard-page .hub-card-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 10px;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.dashboard-page .hub-card-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-page .hub-card:nth-child(2n) .hub-card-icon {
  color: #188038;
  background: rgba(52, 168, 83, 0.11);
}

.dashboard-page .hub-card:nth-child(3n) .hub-card-icon {
  color: #8a4f0b;
  background: rgba(251, 188, 4, 0.13);
}

body.dark.dashboard-page .hub-card:nth-child(2n) .hub-card-icon {
  color: #81c995;
}

body.dark.dashboard-page .hub-card:nth-child(3n) .hub-card-icon {
  color: #fdd663;
}
.dashboard-page .hub-card {
  justify-content: flex-start;
}

.dashboard-page .hub-card-action {
  margin-top: auto;
  padding-top: 14px;
}


/* ==========================================================================\n   FINAL SEARCH + GMAIL-INSPIRED DARK MODE REFINEMENTS — SEPTEMBER 2026\n   Search remains structurally unchanged; these overrides widen its workspace.\n   Dark mode uses the familiar Google Workspace charcoal/blue visual language.\n   ========================================================================== */

/* Search should use the same generous working width as the rest of the app. */
.search-page .content {
  width: 100%;
  max-width: none;
}

.search-page .panel {
  width: 100%;
  max-width: none;
  margin: 0;
}

.search-page .toolbar {
  width: 100%;
  display: flex;
}

.search-page .search-box {
  flex: 1 1 auto;
  min-width: 0;
}

.search-page .search-field-controls {
  width: 100%;
}

/* Gmail / Google Workspace-inspired dark palette. */
body.dark {
  --bg: #202124;
  --surface: #202124;
  --surface-muted: #303134;
  --surface-raised: #292a2d;
  --border: #3c4043;
  --border-strong: #5f6368;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --accent: #8ab4f8;
  --accent-strong: #aecbfa;
  --accent-hover: #a8c7fa;
  --accent-active: #d2e3fc;
  --accent-soft: rgba(138, 180, 248, 0.14);
  --accent-soft-2: rgba(129, 201, 149, 0.13);
  --positive: #81c995;
  --warning: #fdd663;
  --danger: #f28b82;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28), 0 4px 10px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

body.dark,
body.dark .content,
body.dark .shell {
  background: #202124;
  color: #e8eaed;
}

body.dark .sidebar {
  background: #202124;
  border-right-color: #3c4043;
}

body.dark .brand {
  color: #e8eaed;
}

body.dark .sidebar nav a {
  color: #bdc1c6;
}

body.dark .sidebar nav a:hover {
  color: #e8eaed;
  background: #303134;
}

body.dark .sidebar nav a.active {
  color: #d2e3fc;
  background: #394457;
}

body.dark .sidebar .sidebar-footer-btn,
body.dark .sidebar #logout,
body.dark .sidebar .theme-toggle {
  color: #bdc1c6;
  background: transparent;
}

body.dark .sidebar .sidebar-footer-btn:hover,
body.dark .sidebar #logout:hover,
body.dark .sidebar .theme-toggle:hover {
  color: #e8eaed;
  background: #303134;
}

body.dark .compact-toolbar,
body.dark .toolbar {
  background: transparent;
  color: #e8eaed;
}

body.dark .toolbar-title,
body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4,
body.dark strong {
  color: #e8eaed;
}

body.dark .card,
body.dark .panel,
body.dark .stat-card,
body.dark .system-card,
body.dark .member-card,
body.dark .event-result-card,
body.dark .field-settings-item,
body.dark .holiday-summary,
body.dark .calendar-card {
  background: #202124;
  border-color: #3c4043;
  box-shadow: none;
}

body.dark .modal-card,
body.dark .event-details-card,
body.dark.search-page .event-details-card,
body.dark .holiday-modal-card,
body.dark .subject-modal-card,
body.dark .auth-card {
  background: #292a2d;
  border-color: #5f6368;
  color: #e8eaed;
}

body.dark .modal-backdrop,
body.dark .event-details-backdrop,
body.dark.search-page .event-details-backdrop {
  background: rgba(0, 0, 0, 0.58);
}

body.dark .field,
body.dark textarea.field,
body.dark select.field,
body.dark input:not([type="checkbox"]):not([type="radio"]),
body.dark textarea,
body.dark select {
  background: #202124;
  border-color: #5f6368;
  color: #e8eaed;
}

body.dark .field::placeholder,
body.dark textarea::placeholder,
body.dark input::placeholder {
  color: #9aa0a6;
}

body.dark .field:focus,
body.dark textarea.field:focus,
body.dark select.field:focus,
body.dark input:focus,
body.dark textarea:focus,
body.dark select:focus {
  border-color: #8ab4f8;
  box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.22);
  outline: none;
}

body.dark .btn {
  background: #8ab4f8;
  border-color: #8ab4f8;
  color: #202124;
  box-shadow: none;
}

body.dark .btn:hover {
  background: #aecbfa;
  border-color: #aecbfa;
  color: #202124;
  box-shadow: none;
}

body.dark .btn.secondary,
body.dark .icon-btn {
  background: transparent;
  border-color: #5f6368;
  color: #e8eaed;
}

body.dark .btn.secondary:hover,
body.dark .icon-btn:hover {
  background: #303134;
  border-color: #5f6368;
  color: #e8eaed;
}

body.dark .category-tabs,
body.dark .category-tabs-wrap {
  background: #303134;
}

body.dark .category-tab {
  color: #bdc1c6;
}

body.dark .category-tab:hover {
  color: #e8eaed;
  background: #3c4043;
}

body.dark .category-tab.active,
body.dark .category-tab.is-active {
  color: #d2e3fc;
  background: #394457;
  box-shadow: none;
}

body.dark .search-page .search-box,
body.dark.search-page .search-box {
  background: #303134;
  border-color: transparent;
  color: #e8eaed;
}

body.dark.search-page .search-box:focus {
  background: #303134;
  border-color: #8ab4f8;
}

body.dark.search-page .search-field-panel {
  background: #292a2d;
  border-color: #5f6368;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

body.dark.search-page .search-field-option:hover {
  background: #3c4043;
}

body.dark .data-table,
body.dark .holiday-summary-table,
body.dark table {
  color: #e8eaed;
}

body.dark .data-table th,
body.dark .holiday-summary-table th,
body.dark thead th {
  background: #292a2d;
  border-color: #3c4043;
  color: #bdc1c6;
}

body.dark .data-table td,
body.dark .holiday-summary-table td,
body.dark tbody td {
  background: #202124;
  border-color: #3c4043;
  color: #e8eaed;
}

body.dark tbody tr:hover td {
  background: #292a2d;
}

body.dark #calendar,
body.dark #holidayCalendar,
body.dark .fc-scrollgrid,
body.dark .fc-scrollgrid-section,
body.dark .fc-scrollgrid-section-header,
body.dark .fc-scrollgrid-section-body,
body.dark .fc-scrollgrid-sync-table,
body.dark .fc-list-table,
body.dark .fc-popover {
  background: #202124 !important;
  border-color: #3c4043 !important;
  color: #e8eaed;
}

body.dark .fc .fc-col-header-cell,
body.dark .fc-col-header-cell,
body.dark .fc-list-day-cushion {
  background: #292a2d !important;
}

body.dark .fc-theme-standard td,
body.dark .fc-theme-standard th,
body.dark .fc-theme-standard .fc-scrollgrid,
body.dark .fc .fc-timegrid-slot,
body.dark .fc .fc-timegrid-axis {
  border-color: #3c4043 !important;
}

body.dark .fc-daygrid-day-number,
body.dark .fc-col-header-cell-cushion,
body.dark .fc-list-day-text,
body.dark .fc-list-day-side-text,
body.dark .fc-toolbar-title {
  color: #e8eaed !important;
}

body.dark .fc-daygrid-day:hover .fc-daygrid-day-frame {
  background: #292a2d !important;
}

body.dark .fc-day-today .fc-daygrid-day-frame {
  background: rgba(138, 180, 248, 0.08) !important;
}

body.dark .fc-day-today .fc-daygrid-day-number {
  color: #202124 !important;
  background: #8ab4f8 !important;
}

body.dark .fc .fc-button,
body.dark .fc-button {
  background: transparent !important;
  border-color: #5f6368 !important;
  color: #e8eaed !important;
  box-shadow: none !important;
}

body.dark .fc .fc-button:hover,
body.dark .fc-button:hover,
body.dark .fc .fc-button-active,
body.dark .fc-button-active {
  background: #303134 !important;
  border-color: #5f6368 !important;
}

body.dark .hint,
body.dark .event-result-meta,
body.dark .event-result-notes,
body.dark .event-details-meta,
body.dark .dashboard-date-meta,
body.dark .system-status,
body.dark .empty-state {
  color: #9aa0a6;
}

body.dark .archive-badge,
body.dark .calendar-pill,
body.dark .legend-chip {
  border-color: #5f6368;
}

body.dark.dashboard-page .card:first-of-type {
  background: #202124;
  border-color: #3c4043;
}

body.dark.dashboard-page .card:first-of-type::after {
  background: rgba(138, 180, 248, 0.06);
}

body.dark.dashboard-page .hub-card,
body.dark.dashboard-page .hub-card:hover {
  background: #202124;
  border-color: #3c4043;
  box-shadow: none;
}

body.dark.dashboard-page .hub-card:hover {
  background: #292a2d;
}

body.dark .logo-mark {
  background: #8ab4f8 !important;
  color: #202124 !important;
  box-shadow: none;
}

@media (max-width: 640px) {
  .search-page .panel {
    width: 100%;
  }
}

/* ========================================================================== 
   FINAL PRESENTATION-ONLY POLISH
   Scoped to Calendar/Holidays dark FullCalendar surfaces and the shared
   event-details presentation. No behaviour, data, routes or event logic.
   ========================================================================== */

/* Google Calendar-like neutral charcoal calendar canvas in dark mode.
   Keep status/event colours untouched; only remove the blue cast from the
   actual day/week/time grid surfaces. */
body.dark.calendar-page #calendar .fc-scrollgrid,
body.dark.calendar-page #calendar .fc-scrollgrid-section,
body.dark.calendar-page #calendar .fc-scrollgrid-section-header,
body.dark.calendar-page #calendar .fc-scrollgrid-section-body,
body.dark.calendar-page #calendar .fc-scrollgrid-sync-table,
body.dark.calendar-page #calendar .fc-theme-standard td,
body.dark.calendar-page #calendar .fc-theme-standard th,
body.dark.calendar-page #calendar .fc-daygrid-day-frame,
body.dark.calendar-page #calendar .fc-timegrid-slot,
body.dark.calendar-page #calendar .fc-timegrid-axis,
body.dark.calendar-page #holidayCalendar .fc-scrollgrid,
body.dark.calendar-page #holidayCalendar .fc-scrollgrid-section,
body.dark.calendar-page #holidayCalendar .fc-scrollgrid-section-header,
body.dark.calendar-page #holidayCalendar .fc-scrollgrid-section-body,
body.dark.calendar-page #holidayCalendar .fc-scrollgrid-sync-table,
body.dark.calendar-page #holidayCalendar .fc-theme-standard td,
body.dark.calendar-page #holidayCalendar .fc-theme-standard th,
body.dark.calendar-page #holidayCalendar .fc-daygrid-day-frame,
body.dark.calendar-page #holidayCalendar .fc-timegrid-slot,
body.dark.calendar-page #holidayCalendar .fc-timegrid-axis {
  background: #202124 !important;
  border-color: #3c4043 !important;
  color: #e8eaed !important;
}

body.dark.calendar-page #calendar .fc-col-header-cell,
body.dark.calendar-page #holidayCalendar .fc-col-header-cell {
  background: #202124 !important;
  border-color: #3c4043 !important;
}

body.dark.calendar-page #calendar .fc-daygrid-day:hover .fc-daygrid-day-frame,
body.dark.calendar-page #holidayCalendar .fc-daygrid-day:hover .fc-daygrid-day-frame {
  background: #292a2d !important;
}

/* Today stays gently distinguishable without tinting an entire cell blue. */
body.dark.calendar-page #calendar .fc-day-today .fc-daygrid-day-frame,
body.dark.calendar-page #calendar .fc-day-today,
body.dark.calendar-page #holidayCalendar .fc-day-today .fc-daygrid-day-frame,
body.dark.calendar-page #holidayCalendar .fc-day-today {
  background: #292a2d !important;
  border-color: #5f6368 !important;
}

body.dark.calendar-page #calendar .fc-daygrid-day-number,
body.dark.calendar-page #calendar .fc-col-header-cell-cushion,
body.dark.calendar-page #calendar .fc-timegrid-axis-cushion,
body.dark.calendar-page #calendar .fc-timegrid-slot-label-cushion,
body.dark.calendar-page #holidayCalendar .fc-daygrid-day-number,
body.dark.calendar-page #holidayCalendar .fc-col-header-cell-cushion,
body.dark.calendar-page #holidayCalendar .fc-timegrid-axis-cushion,
body.dark.calendar-page #holidayCalendar .fc-timegrid-slot-label-cushion {
  color: #bdc1c6 !important;
}

/* Shared event detail viewer: roomier, calmer and easier to scan. */
body.calendar-page .event-details-card,
body.search-page .event-details-card {
  width: min(860px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 40px));
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}

body.calendar-page .event-details-card .event-details-header,
body.search-page .event-details-card .event-details-header {
  margin: 0;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

body.calendar-page .event-details-card .event-details-title,
body.search-page .event-details-card .event-details-title {
  font-size: 1.28rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
}

body.calendar-page .event-details-card > .category-tabs,
body.search-page .event-details-card > .category-tabs {
  margin: 0;
  padding: 14px 22px 12px;
  min-height: 62px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}

body.calendar-page .event-details-card > #eventDetailsContent,
body.search-page .event-details-card > #eventDetailsContent {
  padding: 20px 22px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 160px;
}

body.calendar-page .event-details-card .detail-list.two-column,
body.search-page .event-details-card .detail-list.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
}

body.calendar-page .event-details-card .detail-list.two-column .detail-row,
body.search-page .event-details-card .detail-list.two-column .detail-row {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 42%, var(--surface));
}

body.calendar-page .event-details-card .detail-list.two-column .detail-row strong,
body.search-page .event-details-card .detail-list.two-column .detail-row strong {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

body.calendar-page .event-details-card .detail-list.two-column .detail-row span,
body.search-page .event-details-card .detail-list.two-column .detail-row span {
  display: block;
  width: 100%;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

body.calendar-page .event-details-card .event-details-meta,
body.search-page .event-details-card .event-details-meta {
  margin: 0;
  padding: 12px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  background: color-mix(in srgb, var(--surface-muted) 35%, var(--surface));
}

body.calendar-page .event-details-card > .actions:last-child,
body.search-page .event-details-card > .actions:last-child {
  margin: 0;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
  gap: 8px;
}

body.dark.calendar-page .event-details-card,
body.dark.search-page .event-details-card {
  background: #202124;
  border-color: #3c4043;
  color: #e8eaed;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.52);
}

body.dark.calendar-page .event-details-card .event-details-header,
body.dark.calendar-page .event-details-card > .category-tabs,
body.dark.calendar-page .event-details-card .event-details-meta,
body.dark.calendar-page .event-details-card > .actions:last-child,
body.dark.search-page .event-details-card .event-details-header,
body.dark.search-page .event-details-card > .category-tabs,
body.dark.search-page .event-details-card .event-details-meta,
body.dark.search-page .event-details-card > .actions:last-child {
  border-color: #3c4043;
}

body.dark.calendar-page .event-details-card .detail-list.two-column .detail-row,
body.dark.search-page .event-details-card .detail-list.two-column .detail-row {
  background: #292a2d;
  border-color: #3c4043;
}

body.dark.calendar-page .event-details-card .detail-list.two-column .detail-row strong,
body.dark.search-page .event-details-card .detail-list.two-column .detail-row strong {
  color: #9aa0a6;
}

body.dark.calendar-page .event-details-card .detail-list.two-column .detail-row span,
body.dark.search-page .event-details-card .detail-list.two-column .detail-row span {
  color: #e8eaed;
}

body.dark.calendar-page .event-details-card .event-details-meta,
body.dark.search-page .event-details-card .event-details-meta {
  background: #252629;
  color: #9aa0a6;
}

@media (max-width: 680px) {
  body.calendar-page .event-details-card,
  body.search-page .event-details-card {
    width: min(100%, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
  }

  body.calendar-page .event-details-card .detail-list.two-column,
  body.search-page .event-details-card .detail-list.two-column {
    grid-template-columns: 1fr;
  }

  body.calendar-page .event-details-card .event-details-header,
  body.search-page .event-details-card .event-details-header,
  body.calendar-page .event-details-card > #eventDetailsContent,
  body.search-page .event-details-card > #eventDetailsContent,
  body.calendar-page .event-details-card .event-details-meta,
  body.search-page .event-details-card .event-details-meta,
  body.calendar-page .event-details-card > .actions:last-child,
  body.search-page .event-details-card > .actions:last-child {
    padding-left: 16px;
    padding-right: 16px;
  }

  body.calendar-page .event-details-card > .category-tabs,
  body.search-page .event-details-card > .category-tabs {
    padding-left: 16px;
    padding-right: 16px;
  }
}


/* ==========================================================================
   FINAL DARK-MODE SURFACE CONSISTENCY — PRESENTATION ONLY
   Added 2026-09-10. No behaviour, markup, data or JavaScript is changed.
   ========================================================================== */

/* Dashboard: remove the decorative clipped shape from the welcome card. */
.dashboard-page .card:first-of-type::after {
  display: none !important;
}

/* Calendar / Holidays: Gmail-like neutral charcoal surfaces.
   Keep event/status colours intact; only surrounding UI chrome is neutralised. */
body.dark.calendar-page .toolbar,
body.dark.calendar-page .compact-toolbar,
body.dark.calendar-page .calendar-legend,
body.dark.calendar-page .calendar-card,
body.dark.calendar-page #calendar,
body.dark.calendar-page #holidayCalendar {
  background: #202124 !important;
  border-color: #3c4043 !important;
  color: #e8eaed !important;
  box-shadow: none !important;
}

body.dark.calendar-page .fc .fc-button-group {
  background: #292a2d !important;
  border-color: #5f6368 !important;
  box-shadow: none !important;
}

body.dark.calendar-page .fc .fc-button,
body.dark.calendar-page .fc .fc-button-primary {
  background: transparent !important;
  border-color: transparent !important;
  color: #bdc1c6 !important;
  box-shadow: none !important;
}

body.dark.calendar-page .fc .fc-button:hover,
body.dark.calendar-page .fc .fc-button:focus {
  background: #303134 !important;
  color: #e8eaed !important;
}

body.dark.calendar-page .fc .fc-button-primary:not(:disabled).fc-button-active,
body.dark.calendar-page .fc .fc-button-active {
  background: #3c4043 !important;
  border-color: #5f6368 !important;
  color: #e8eaed !important;
  box-shadow: none !important;
}

body.dark.calendar-page .fc-col-header-cell,
body.dark.calendar-page .fc .fc-col-header-cell,
body.dark.calendar-page .fc-list-day-cushion {
  background: #292a2d !important;
  border-color: #3c4043 !important;
  color: #bdc1c6 !important;
}

body.dark.calendar-page .toolbar .field,
body.dark.calendar-page .calendar-legend,
body.dark.calendar-page .legend-chip,
body.dark.calendar-page .calendar-pill {
  background-color: #292a2d !important;
  border-color: #5f6368 !important;
  color: #e8eaed !important;
}

/* Instructor Directory: replace old navy/blue panel styling with Google charcoal. */
body.dark .instructor-list-panel,
body.dark .instructor-form-panel,
body.dark .instructor-card,
body.dark .subject-row,
body.dark .subject-modal-card,
body.dark .subject-select {
  background: #202124 !important;
  border-color: #3c4043 !important;
  color: #e8eaed !important;
  box-shadow: none !important;
}

body.dark .instructor-card:hover,
body.dark .subject-row:hover {
  background: #292a2d !important;
}

body.dark .instructor-card-title {
  color: #e8eaed !important;
}

body.dark .instructor-meta {
  color: #bdc1c6 !important;
}

body.dark .instructor-badge {
  background: #303134 !important;
  border-color: #5f6368 !important;
  color: #e8eaed !important;
}

body.dark .instructor-badge.inactive {
  background: #303134 !important;
  border-color: #5f6368 !important;
  color: #f28b82 !important;
}

/* Edit Event Fields: neutralise the old blue field/category surfaces. */
body.dark .field-settings-item,
body.dark .field-settings-item.is-protected {
  background: #202124 !important;
  border-color: #3c4043 !important;
  color: #e8eaed !important;
  box-shadow: none !important;
}

body.dark .field-settings-item:hover {
  background: #292a2d !important;
}

body.dark .field-settings-item .order,
body.dark .field-settings-item .item-sub {
  color: #bdc1c6 !important;
}

body.dark .category-tabs,
body.dark .category-tabs-wrap,
body.dark .category-tabs-top {
  background: #202124 !important;
  border-color: #3c4043 !important;
}

body.dark .category-tab {
  background: #292a2d !important;
  border-color: #5f6368 !important;
  color: #bdc1c6 !important;
  box-shadow: none !important;
}

body.dark .category-tab:hover {
  background: #303134 !important;
  color: #e8eaed !important;
}

body.dark .category-tab.active,
body.dark .category-tab.is-active {
  background: #3c4043 !important;
  border-color: #5f6368 !important;
  color: #e8eaed !important;
  box-shadow: none !important;
}


/* ==========================================================================\n   RESPONSIVE SIDEBAR BREAKPOINT CONSISTENCY FIX\n   Sidebar/layout only. Aligns CSS with app.js mobile breakpoint (960px).\n   ========================================================================== */
@media (max-width: 960px) {
  /* The sidebar is an overlay drawer at this width. It must not consume a
     grid column or make the page content collapse/disappear. */
  .shell,
  .shell.sidebar-collapsed,
  html.vt-sidebar-collapsed .shell {
    grid-template-columns: minmax(0, 1fr) !important;
    --vt-shell-sidebar-width: 0px !important;
  }

  .content {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Match the working compact-width drawer behaviour used by the earlier
     build, extended through 960px to match the JavaScript media query. */
  .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: min(84vw, 320px) !important;
    height: 100dvh !important;
    z-index: 1200 !important;
    transform: translateX(-100%) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto !important;
    visibility: visible !important;
  }

  .shell.sidebar-open .sidebar {
    transform: translateX(0) !important;
    pointer-events: auto !important;
  }

  .sidebar nav,
  .sidebar nav a,
  .sidebar button,
  .sidebar .sidebar-footer-btn {
    pointer-events: auto !important;
  }

  /* Backdrop must remain behind the drawer so links never become
     unclickable/greyed-out. */
  body.sidebar-overlay-open::before {
    z-index: 1100 !important;
  }
}

@media (max-width: 640px) {
  .sidebar {
    width: min(88vw, 320px) !important;
  }
}

/* ========================================================================== 
   MOBILE / TABLET RESPONSIVE PRESENTATION CHECK — 2026-09-29
   Presentation only. No JavaScript, routes, forms, data or application logic.
   ========================================================================== */

/* At the same breakpoint used by app.js for the collapsible drawer, the
   opened sidebar becomes a true full-screen mobile menu. Desktop behaviour is
   untouched because every rule here is scoped to max-width: 960px. */
@media (max-width: 960px) {
  .sidebar {
    inset: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    box-sizing: border-box !important;
  }

  /* Keep the existing sidebar toggle available while the full-width menu is
     open. This is the same button and same behaviour; only its mobile visual
     position changes so users are never trapped in the drawer. */
  .shell.sidebar-open [data-sidebar-toggle] {
    position: fixed !important;
    top: max(12px, env(safe-area-inset-top)) !important;
    right: max(12px, env(safe-area-inset-right)) !important;
    left: auto !important;
    z-index: 1300 !important;
    margin: 0 !important;
    background: var(--surface) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
  }

  /* General responsive containment: preserve every control while preventing
     cards, toolbars and flexible/grid children from forcing the viewport
     wider than the device. */
  .content,
  .compact-toolbar,
  .toolbar,
  .toolbar-left,
  .toolbar-center,
  .toolbar-right,
  .page-header,
  .header-actions,
  .actions,
  .card,
  .panel,
  .form-card,
  .calendar-shell,
  .hub-card,
  .system-card,
  .member-card,
  .event-result-card,
  .field-settings-item,
  .instructor-card,
  .holiday-summary {
    min-width: 0 !important;
    max-width: 100%;
  }

  .page-header,
  .panel-header,
  .card-row,
  .header-actions,
  .actions,
  .system-inline-actions,
  .instructor-card-top,
  .instructor-card-actions,
  .instructor-list-toolbar {
    flex-wrap: wrap;
  }

  .table-shell {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  img,
  video,
  canvas {
    max-width: 100%;
    height: auto;
  }

  .modal-card,
  .subject-modal-card,
  .holiday-modal-card,
  .event-details-card,
  .search-page .event-details-card {
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
  }

  #calendar,
  #holidayCalendar,
  .fc,
  .fc-view-harness {
    min-width: 0;
    max-width: 100%;
  }

  .sidebar nav a,
  .sidebar .sidebar-footer-btn,
  .sidebar #logout,
  .sidebar .theme-toggle {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  /* Long labels and user-entered text should wrap rather than push a narrow
     phone viewport sideways. */
  .toolbar-title,
  .panel-header,
  .card-row,
  .member-card,
  .system-card,
  .event-result-card,
  .field-settings-item,
  .subject-row,
  .hint,
  .detail-row,
  .list li {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .toolbar-title {
    white-space: normal;
    text-align: center;
  }

  .view-toggle,
  .category-tabs,
  .category-tabs-wrap,
  .category-tabs-top {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .field,
  input,
  select,
  textarea,
  .search-box {
    max-width: 100%;
    min-width: 0;
  }

  .btn,
  .icon-btn,
  .theme-toggle,
  .sidebar-footer-btn {
    flex-shrink: 0;
  }
}


.password-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(31, 41, 55, 0.46);
  backdrop-filter: blur(3px);
}
.password-modal-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
body.dark .password-modal-card {
  background: var(--surface-raised);
}
@media (max-width: 640px) {
  .password-modal-backdrop { padding: 12px; }
  .password-modal-card { width: 100%; max-height: calc(100vh - 24px); }
}

/* Company Members: keep profile content and account actions responsive inside each card. */
.members-grid .member-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  row-gap: 12px;
  min-width: 0;
}

.members-grid .member-card > div:nth-child(2) {
  min-width: 0;
  overflow-wrap: anywhere;
}

.members-grid .member-card > .actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
  align-items: stretch;
}

.members-grid .member-card > .actions .btn {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  flex-shrink: 1;
}

@media (max-width: 480px) {
  .members-grid .member-card > .actions {
    grid-template-columns: 1fr;
  }
}

/* Copy a value from a read-only Calendar/Search event-details card. */
body.calendar-page #eventDetailsContent .detail-row,
body.search-page #eventDetailsContent .detail-row {
  position: relative;
  padding-right: 50px;
}

body.calendar-page #eventDetailsContent .detail-copy-btn,
body.search-page #eventDetailsContent .detail-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.75;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

body.calendar-page #eventDetailsContent .detail-copy-btn:hover,
body.search-page #eventDetailsContent .detail-copy-btn:hover,
body.calendar-page #eventDetailsContent .detail-copy-btn:focus-visible,
body.search-page #eventDetailsContent .detail-copy-btn:focus-visible {
  background: var(--surface-muted);
  color: var(--text);
  border-color: var(--border);
  opacity: 1;
}

body.calendar-page #eventDetailsContent .detail-copy-btn:focus-visible,
body.search-page #eventDetailsContent .detail-copy-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

body.calendar-page #eventDetailsContent .detail-copy-btn.is-copied,
body.search-page #eventDetailsContent .detail-copy-btn.is-copied {
  color: #188038;
  opacity: 1;
}

body.dark.calendar-page #eventDetailsContent .detail-copy-btn.is-copied,
body.dark.search-page #eventDetailsContent .detail-copy-btn.is-copied {
  color: #81c995;
}


/* Read-only instructor directory card beside the shared Calendar/Search viewer. */
body.calendar-page #eventDetailsContent .instructor-name-link,
body.search-page #eventDetailsContent .instructor-name-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: #2763b0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
body.dark.calendar-page #eventDetailsContent .instructor-name-link,
body.dark.search-page #eventDetailsContent .instructor-name-link { color: #a4c8ff; }
body.calendar-page #eventDetailsContent .instructor-name-link:focus-visible,
body.search-page #eventDetailsContent .instructor-name-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 2px;
}

body.calendar-page .event-details-backdrop.has-instructor-card,
body.search-page .event-details-backdrop.has-instructor-card {
  gap: 16px;
  justify-content: center;
  align-items: flex-start;
}
body.calendar-page .event-details-backdrop.has-instructor-card .event-details-card,
body.search-page .event-details-backdrop.has-instructor-card .event-details-card {
  margin: 0;
  flex: 0 1 860px;
  min-width: 0;
}
body.calendar-page .instructor-contact-card,
body.search-page .instructor-contact-card {
  display: none;
  order: -1;
  flex: 0 0 290px;
  width: 290px;
  min-width: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.17);
  border-radius: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - 48px);
}
body.calendar-page .instructor-contact-card.is-open,
body.search-page .instructor-contact-card.is-open { display: block; }
.instructor-contact-header {
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.instructor-contact-header h3 { font-size: 1rem; margin: 0; font-weight: 650; }
.instructor-contact-close {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 22px;
  height: 32px;
  width: 32px;
  cursor: pointer;
}
.instructor-contact-close:hover { background: var(--surface-muted); }
.instructor-contact-body { padding: 15px 16px; display: grid; gap: 16px; font-size: 0.9rem; }
.instructor-contact-field { display: grid; gap: 6px; min-width: 0; }
.instructor-contact-field > strong { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.instructor-contact-value { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.instructor-contact-value > span { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.45; }
.instructor-contact-value .instructor-contact-missing { color: var(--muted); font-style: italic; }
/* Long directory notes stay readable without extending over the course details. */
.instructor-contact-field-notes .instructor-contact-value > span {
  max-height: 240px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.instructor-contact-copy {
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  margin-top: -3px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.instructor-contact-copy:hover, .instructor-contact-copy:focus-visible {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}
.instructor-contact-copy.is-copied { color: #188038; }
body.dark .instructor-contact-copy.is-copied { color: #81c995; }
body.dark .instructor-contact-card {
  background: #202124;
  border-color: #3c4043;
  color: #e8eaed;
  box-shadow: 0 20px 55px rgba(0,0,0,0.5);
}
body.dark .instructor-contact-header { border-color: #3c4043; }
@media (max-width: 1199px) {
  body.calendar-page .event-details-backdrop.has-instructor-card,
  body.search-page .event-details-backdrop.has-instructor-card {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
  }
  body.calendar-page .event-details-backdrop.has-instructor-card .event-details-card,
  body.search-page .event-details-backdrop.has-instructor-card .event-details-card {
    order: 0;
    flex: 0 1 auto;
    width: min(860px, calc(100vw - 32px));
  }
  body.calendar-page .event-details-backdrop.has-instructor-card .instructor-contact-card,
  body.search-page .event-details-backdrop.has-instructor-card .instructor-contact-card {
    order: 1;
    flex: 0 0 auto;
    width: min(860px, calc(100vw - 32px));
  }
}


/* ==========================================================================
   OCTOBER 2026 — NEUTRAL DARK-MODE FINISH (CSS only)
   Preserve the existing blue action colour and event/status colours.
   Neutralise leftover navy surfaces from older page-specific theme rules.
   ========================================================================== */

/* Navigation selection is charcoal rather than blue-grey in dark mode. */
body.dark .sidebar nav a.active {
  background: #303134;
  color: #e8eaed;
}

/* Holidays: sidebar summary, the add-holiday popup and sticky toolbar. */
body.dark.calendar-page .holidays-layout .holiday-summary,
body.dark.calendar-page .holidays-layout #holidayCalendar,
body.dark.calendar-page .holiday-toolbar {
  background: #202124 !important;
  border-color: #3c4043 !important;
  color: #e8eaed;
}
body.dark.calendar-page .holiday-modal-card {
  background: #292a2d !important;
  border-color: #5f6368 !important;
  color: #e8eaed;
}
body.dark.calendar-page .holiday-modal-card .field,
body.dark.calendar-page .holiday-modal-card textarea,
body.dark.calendar-page .holiday-modal-card select {
  background: #202124 !important;
  border-color: #5f6368 !important;
  color: #e8eaed !important;
}

/* Calendar: form inputs/edit text areas should match the course viewer. */
body.dark.calendar-page .modal-card .field,
body.dark.calendar-page .modal-card textarea,
body.dark.calendar-page .modal-card select {
  background: #202124 !important;
  border-color: #5f6368 !important;
  color: #e8eaed !important;
}
body.dark.calendar-page .modal-card .field:focus,
body.dark.calendar-page .modal-card textarea:focus,
body.dark.calendar-page .holiday-modal-card .field:focus {
  border-color: #8ab4f8 !important;
}

/* Calendar Month / Week / Day: the selected blue is exactly the dark-mode
   Add Course blue; inactive view options remain understated charcoal. */
body.dark.calendar-page .view-toggle .btn {
  background: #292a2d;
  color: #e8eaed;
  border-color: #5f6368;
  box-shadow: none;
}
body.dark.calendar-page .view-toggle .btn:hover:not(.is-active) {
  background: #3c4043;
  color: #e8eaed;
}
body.dark.calendar-page .view-toggle .btn.is-active,
body.dark.calendar-page .view-toggle .btn.is-active:hover {
  background: #8ab4f8;
  border-color: #8ab4f8;
  color: #202124;
  box-shadow: none;
}

/* Search: field selection dropdown and instructor suggestions. More specific
   selectors override the old navy rules embedded in search.html. */
body.dark.search-page .search-field-panel,
body.dark.search-page .search-field-selector-search-wrap,
body.dark.search-page .search-instructor-suggestions {
  background: #292a2d !important;
  border-color: #5f6368 !important;
  color: #e8eaed;
}
body.dark.search-page .search-field-option:hover,
body.dark.search-page .search-instructor-suggestion:hover,
body.dark.search-page .search-instructor-suggestion.is-active {
  background: #3c4043 !important;
}

/* ZOS weekly sheet: subtle charcoal distinction instead of navy fill. */
body.dark .system-notes-row td,
body.dark .data-table thead th {
  background: #292a2d !important;
}
body.dark .current-week-row td {
  background: #303134 !important;
}
body.dark .current-week-row input {
  background: #292a2d !important;
}

/* 2026-10-23: Consistent compact toolbars across the working pages.
   Scope is intentional: Dashboard and Calendar retain their existing styling;
   no event forms, cards, grids, field logic or global button styles change. */
body:not(.dashboard-page):not(.calendar-page) .compact-toolbar,
body.holidays-page .compact-toolbar.holiday-toolbar,
body:not(.dashboard-page):not(.calendar-page) .page-header {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 50px;
  height: auto !important;
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid #e1e4e8 !important;
  border-radius: 10px !important;
  background: #f8f9fa !important;
  box-shadow: none !important;
  color: #242a32;
  font-family: "Segoe UI Variable Text", "Segoe UI Variable", "Inter", "Segoe UI", system-ui, sans-serif;
}

body:not(.dashboard-page):not(.calendar-page) .compact-toolbar,
body.holidays-page .compact-toolbar.holiday-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  overflow: visible;
}

body:not(.dashboard-page):not(.calendar-page) .compact-toolbar .toolbar-left,
body:not(.dashboard-page):not(.calendar-page) .compact-toolbar .toolbar-center,
body:not(.dashboard-page):not(.calendar-page) .compact-toolbar .toolbar-right,
body.holidays-page .compact-toolbar.holiday-toolbar .toolbar-left,
body.holidays-page .compact-toolbar.holiday-toolbar .toolbar-center,
body.holidays-page .compact-toolbar.holiday-toolbar .toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

body:not(.dashboard-page):not(.calendar-page) .compact-toolbar .toolbar-center {
  flex: 1 1 140px;
  justify-content: flex-start;
  order: 0;
}
body:not(.dashboard-page):not(.calendar-page) .compact-toolbar .toolbar-right {
  flex: 0 1 auto;
  justify-content: flex-end;
  margin-left: auto;
}

body:not(.dashboard-page):not(.calendar-page) .compact-toolbar .toolbar-title,
body.holidays-page .compact-toolbar.holiday-toolbar .toolbar-title {
  margin: 0;
  color: #242a32 !important;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.02em;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

body:not(.dashboard-page):not(.calendar-page) .compact-toolbar :is(.btn, .icon-btn),
body.holidays-page .compact-toolbar.holiday-toolbar :is(.btn, .icon-btn),
body.holidays-page .holiday-view-picker select,
body:not(.dashboard-page):not(.calendar-page) .page-header .header-actions .btn {
  box-sizing: border-box;
  min-height: 36px;
  border-radius: 8px !important;
  font: 500 .88rem "Segoe UI Variable Text", "Segoe UI Variable", "Inter", "Segoe UI", system-ui, sans-serif;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
body:not(.dashboard-page):not(.calendar-page) .compact-toolbar .icon-btn {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 7px;
  color: #343b45;
  background: #f3f4f6;
  border: 1px solid #d9dde3;
  box-shadow: none;
}
body:not(.dashboard-page):not(.calendar-page) .compact-toolbar :is(.icon-btn, .btn.secondary):hover,
body:not(.dashboard-page):not(.calendar-page) .page-header .header-actions .btn.secondary:hover {
  background: #e8ebef;
  border-color: #bac2cc;
  color: #222831;
}
body:not(.dashboard-page):not(.calendar-page) :is(.compact-toolbar, .page-header) :is(button, a):focus-visible,
body.holidays-page .compact-toolbar.holiday-toolbar :is(button, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The administration pages use page-header instead of compact-toolbar. */
body:not(.dashboard-page):not(.calendar-page) .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
}
body:not(.dashboard-page):not(.calendar-page) .page-header h1 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -.025em;
}
body:not(.dashboard-page):not(.calendar-page) .page-header .eyebrow {
  margin-bottom: 3px;
}
body:not(.dashboard-page):not(.calendar-page) .page-header .hint {
  margin: 3px 0 0;
  line-height: 1.35;
}
body:not(.dashboard-page):not(.calendar-page) .page-header .header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* The Search controls remain in their original panel and retain their IDs. */
body.search-page .panel > .toolbar,
body:not(.dashboard-page):not(.calendar-page) .instructor-list-toolbar {
  gap: 8px;
  padding: 8px;
  border-radius: 9px !important;
  background: #f8f9fa;
  border: 1px solid #e1e4e8;
}
body.search-page .panel > .toolbar :is(.btn, .field),
body:not(.dashboard-page):not(.calendar-page) .instructor-list-toolbar .field {
  border-radius: 8px !important;
  min-height: 36px;
}

body.dark:not(.dashboard-page):not(.calendar-page) .compact-toolbar,
body.dark.holidays-page .compact-toolbar.holiday-toolbar,
body.dark:not(.dashboard-page):not(.calendar-page) .page-header {
  background: #202124 !important;
  border-color: #3c4043 !important;
  color: #e8eaed;
}
body.dark:not(.dashboard-page):not(.calendar-page) .compact-toolbar .toolbar-title,
body.dark.holidays-page .compact-toolbar.holiday-toolbar .toolbar-title,
body.dark:not(.dashboard-page):not(.calendar-page) .page-header h1 {
  color: #e8eaed !important;
}
body.dark:not(.dashboard-page):not(.calendar-page) .compact-toolbar .icon-btn {
  background: #2a2c30;
  border-color: #4b4e52;
  color: #e2e4e7;
}
body.dark:not(.dashboard-page):not(.calendar-page) .compact-toolbar :is(.icon-btn, .btn.secondary):hover,
body.dark:not(.dashboard-page):not(.calendar-page) .page-header .header-actions .btn.secondary:hover {
  background: #393c40;
  border-color: #72757a;
  color: #fff;
}
body.dark.search-page .panel > .toolbar,
body.dark:not(.dashboard-page):not(.calendar-page) .instructor-list-toolbar {
  background: #242629;
  border-color: #3c4043;
}

@media (max-width: 700px) {
  body:not(.dashboard-page):not(.calendar-page) .compact-toolbar {
    gap: 8px;
    padding: 9px 10px;
  }
  body:not(.dashboard-page):not(.calendar-page) .compact-toolbar .toolbar-left {
    flex: 0 0 auto;
    justify-content: flex-start;
    order: 0;
  }
  body:not(.dashboard-page):not(.calendar-page) .compact-toolbar .toolbar-center {
    flex: 1 1 140px;
    width: auto;
    justify-content: flex-start;
    order: 1;
  }
  body:not(.dashboard-page):not(.calendar-page) .compact-toolbar .toolbar-right {
    flex: 1 1 100%;
    justify-content: flex-start;
    margin-left: 0;
    order: 2;
  }
  body:not(.dashboard-page):not(.calendar-page) .page-header {
    align-items: flex-start;
    padding: 10px;
  }
  body.holidays-page .compact-toolbar.holiday-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  body:not(.dashboard-page):not(.calendar-page) .compact-toolbar :is(.btn, .icon-btn),
  body.holidays-page .compact-toolbar.holiday-toolbar :is(.btn, .icon-btn),
  body:not(.dashboard-page):not(.calendar-page) .page-header .header-actions .btn {
    transition: none;
  }
}
