/*
 * IUM branding for LibreBooking 7 (Bootstrap 5), matching the new IUM
 * website (websitebeta).
 *
 * Loaded after librebooking.css and the page CSS through the config key
 * `css.extension.file` => 'custom.css' (resolved under Web/css/).
 *
 * Source of truth: the IUM Website Branding Guide (websitebeta Backlog
 * doc-1) and its tokens in websitebeta resources/css/app.css (@theme).
 * The --ium-* custom properties below mirror those tokens one to one;
 * everything else in this file refers to them, never to raw hex values.
 *
 * No Smarty template is overridden: every rule here is CSS on upstream
 * markup, so upstream merges do not conflict with the branding.
 * Contrast ratios for every text/background pair are recorded in Backlog
 * TASK-2 (all pass WCAG AA 4.5:1).
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ---------------------------------------------------------------------------
 * 1. Brand tokens (Branding Guide sections 3 to 8)
 * ------------------------------------------------------------------------- */
:root {
  /* Primary: IUM Green (base 600) */
  --ium-primary-50: #f0f8f3;
  --ium-primary-100: #dcefe3;
  --ium-primary-200: #b9dec8;
  --ium-primary-300: #8cc7a5;
  --ium-primary-400: #56aa7b;
  --ium-primary-500: #2a8f57;
  --ium-primary-600: #157a44;
  --ium-primary-700: #116337;
  --ium-primary-800: #0f4f2d;
  --ium-primary-900: #0d4126;
  --ium-primary-950: #062515;

  /* Secondary: Scholar Gold (base 500). Never white text on gold; gold
     text on light backgrounds only from 700 up. */
  --ium-secondary-50: #fdf8eb;
  --ium-secondary-100: #faeecc;
  --ium-secondary-200: #f4dc97;
  --ium-secondary-300: #edc55c;
  --ium-secondary-400: #e2ae2e;
  --ium-secondary-500: #cf990f;
  --ium-secondary-600: #b07f0c;
  --ium-secondary-700: #8c630e;
  --ium-secondary-800: #734f12;
  --ium-secondary-900: #5f4113;
  --ium-secondary-950: #372307;

  /* Minor accent: Lagoon Teal (information, never primary actions) */
  --ium-lagoon-50: #eef8f9;
  --ium-lagoon-100: #d3eef0;
  --ium-lagoon-500: #1e8c99;
  --ium-lagoon-700: #0e6e7a;
  --ium-lagoon-900: #0b4750;

  /* Neutrals: Sand */
  --ium-sand-50: #faf8f4;
  --ium-sand-100: #f3f0e9;
  --ium-sand-200: #e6e1d6;
  --ium-sand-300: #d2cbbc;
  --ium-sand-400: #a9a091;
  --ium-sand-500: #807868;
  --ium-sand-600: #625b4e;
  --ium-sand-700: #4a453b;
  --ium-sand-800: #322e28;
  --ium-sand-900: #1f1d19;
  --ium-sand-950: #12110e;

  /* Status (Guide section 7) */
  --ium-warning-50: #fef6ee;
  --ium-warning-700: #b54708;
  --ium-error-50: #fef3f2;
  --ium-error-700: #b42318;

  /* Semantic tokens (Guide section 8) */
  --ium-primary: var(--ium-primary-600);
  --ium-primary-hover: var(--ium-primary-700);
  --ium-on-primary: #ffffff;
  --ium-secondary: var(--ium-secondary-500);
  --ium-secondary-hover: var(--ium-secondary-400);
  --ium-on-secondary: var(--ium-primary-950);
  --ium-background: var(--ium-sand-50);
  --ium-surface: #ffffff;
  --ium-surface-alt: var(--ium-sand-100);
  --ium-border: var(--ium-sand-200);
  --ium-text: var(--ium-sand-900);
  --ium-muted: var(--ium-sand-600);
  --ium-link: var(--ium-primary-600);
  --ium-link-hover: var(--ium-primary-700);
  --ium-footer-bg: var(--ium-primary-950);
  --ium-on-footer: var(--ium-primary-200);
  --ium-header-bg: var(--ium-primary-950);
  --ium-on-header: var(--ium-primary-100);
  --ium-focus: var(--ium-secondary-500);

  --ium-font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ium-radius: 0.25rem;
  --ium-shadow-soft: 0 20px 60px rgb(21, 122, 68, 0.1);
  --ium-shadow-card: 0 1px 2px rgb(31, 29, 25, 0.04), 0 4px 16px rgb(31, 29, 25, 0.04);

  /* Focus ring: the Guide's 2px gold ring at a 2px offset. A 2px dark
     inner ring is added so the indicator also reaches 3:1 against white
     and sand (gold alone is 2.56:1 on white; WCAG technique C40). */
  --ium-focus-ring: 0 0 0 2px var(--ium-primary-950);

  /* Eight-point star motif from the logo (websitebeta bg-star-pattern) */
  --ium-star-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='1.5'%3E%3Crect x='20' y='20' width='24' height='24'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E");
  --ium-gold-rule: linear-gradient(
    to right,
    var(--ium-secondary-500),
    var(--ium-secondary-400),
    var(--ium-primary-700)
  );

  /* LibreBooking schedule variables (librebooking.css :root), remapped */
  --color-lines: var(--ium-sand-200);
  --reservable: #ffffff;
  --unreservable: var(--ium-sand-200);
  --reserved: var(--ium-primary-700);
  --reservedMine: var(--ium-secondary-500);
  --reservedParticipating: var(--ium-lagoon-700);
  --reservedPending: var(--ium-secondary-100);
  --pasttime: var(--ium-sand-100);
  --hiliteReservation: var(--ium-primary-200);
  --label-text-on-light: var(--ium-sand-900);
  --label-text-on-dark: #ffffff;
}

/* ---------------------------------------------------------------------------
 * 2. LibreBooking theme and Bootstrap 5 variables
 * `body[data-bs-theme]` outranks librebooking.css's [data-bs-theme='…']
 * rules, so the IUM palette applies whichever `css.theme` is configured.
 * ------------------------------------------------------------------------- */
body[data-bs-theme] {
  --primary: var(--ium-primary-600);
  --primary-hover: var(--ium-primary-700);
  --primary-disabled: var(--ium-primary-100);
  --text-color-btn: var(--ium-on-primary);

  --bs-primary: var(--ium-primary-600);
  --bs-primary-rgb: 21, 122, 68;
  --bs-primary-text-emphasis: var(--ium-primary-800);
  --bs-primary-bg-subtle: var(--ium-primary-50);
  --bs-primary-border-subtle: var(--ium-primary-200);
  --bs-secondary-color: var(--ium-sand-600);
  --bs-secondary-bg: var(--ium-sand-100);
  --bs-tertiary-bg: var(--ium-sand-50);
  --bs-success: var(--ium-primary-700);
  --bs-success-rgb: 17, 99, 55;
  --bs-info: var(--ium-lagoon-700);
  --bs-info-rgb: 14, 110, 122;
  --bs-warning: var(--ium-secondary-500);
  --bs-warning-rgb: 207, 153, 15;
  --bs-danger: var(--ium-error-700);
  --bs-danger-rgb: 180, 35, 24;
  --bs-light-rgb: 243, 240, 233;
  --bs-dark-rgb: 31, 29, 25;
  --bs-body-font-family: var(--ium-font);
  --bs-body-font-size: 0.9375rem;
  --bs-body-line-height: 1.6;
  --bs-body-color: var(--ium-text);
  --bs-body-color-rgb: 31, 29, 25;
  --bs-body-bg: var(--ium-background);
  --bs-emphasis-color: var(--ium-sand-950);
  --bs-heading-color: var(--ium-sand-900);
  --bs-link-color: var(--ium-link);
  --bs-link-color-rgb: 21, 122, 68;
  --bs-link-hover-color: var(--ium-link-hover);
  --bs-link-hover-color-rgb: 17, 99, 55;
  --bs-border-color: var(--ium-border);
  --bs-border-color-translucent: rgb(31, 29, 25, 0.1);
  --bs-border-radius: var(--ium-radius);
  --bs-border-radius-sm: var(--ium-radius);
  --bs-border-radius-lg: var(--ium-radius);
  --bs-border-radius-xl: var(--ium-radius);
  --bs-border-radius-xxl: var(--ium-radius);
  --bs-box-shadow: var(--ium-shadow-card);
  --bs-box-shadow-sm: var(--ium-shadow-card);
  --bs-box-shadow-lg: var(--ium-shadow-soft);
  --bs-focus-ring-color: var(--ium-focus);
  --bs-form-valid-color: var(--ium-primary-700);
  --bs-form-valid-border-color: var(--ium-primary-600);
  --bs-form-invalid-color: var(--ium-error-700);
  --bs-form-invalid-border-color: var(--ium-error-700);

  font-family: var(--ium-font);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ium-text);
  background-color: var(--ium-background);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  color: var(--ium-sand-900);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Page titles: the website's gold bar beside section headings */
#main h1 {
  font-size: 1.75rem;
  border-left: 4px solid var(--ium-secondary-500);
  padding-left: 0.75rem;
  line-height: 1.25;
}

#main h1.border-bottom {
  border-bottom-color: var(--ium-border) !important;
  padding-bottom: 0.5rem;
}

a {
  color: var(--ium-link);
}

a:hover {
  color: var(--ium-link-hover);
}

.text-muted,
.text-body-secondary {
  color: var(--ium-muted) !important;
}

.text-danger {
  color: var(--ium-error-700) !important;
}

.text-success {
  color: var(--ium-primary-700) !important;
}

.text-primary {
  color: var(--ium-primary-600) !important;
}

::selection {
  background-color: var(--ium-secondary-200);
  color: var(--ium-primary-950);
}

/* ---------------------------------------------------------------------------
 * 3. Focus: gold ring on every interactive element
 * ------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--ium-focus);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
[role='button']:focus-visible,
summary:focus-visible,
.btn:focus-visible,
.btn-check:focus-visible + .btn,
.nav-link:focus-visible,
.dropdown-item:focus-visible,
.page-link:focus-visible,
.accordion-button:focus-visible,
.btn-close:focus-visible,
.navbar-toggler:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus-visible,
.fc .fc-button:focus-visible,
.flatpickr-day:focus {
  outline: 2px solid var(--ium-focus);
  outline-offset: 2px;
  box-shadow: var(--ium-focus-ring);
}

.btn:focus:not(:focus-visible),
.accordion-button:focus:not(:focus-visible),
.btn-close:focus:not(:focus-visible),
.navbar-toggler:focus:not(:focus-visible),
.page-link:focus:not(:focus-visible),
.form-check-input:focus:not(:focus-visible) {
  box-shadow: none;
}

/* ---------------------------------------------------------------------------
 * 4. Header: dark green band matching the footer (primary-950), with the
 *    colour emblem, white title and light nav links. The Guide allows the
 *    logo on a primary-950 background. Contrast on primary-950:
 *    white 16.37, primary-100 13.64, secondary-300 9.93.
 * ------------------------------------------------------------------------- */
body > div.d-flex:has(> a.navbar-brand) {
  margin: 0 !important;
  padding: 0.75rem 1rem 0.5rem;
  background-color: var(--ium-header-bg);
  color: #ffffff;
  gap: 0.75rem !important;
}

body > div.d-flex:has(> a.navbar-brand) .border-start {
  border-color: rgb(255, 255, 255, 0.2) !important;
  padding-left: 0.75rem !important;
}

body > div.d-flex:has(> a.navbar-brand) h5 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

body > div.d-flex:has(> a.navbar-brand) h5,
body > div.d-flex:has(> a.navbar-brand) a.link-primary {
  color: #ffffff !important;
}

body > div.d-flex:has(> a.navbar-brand) a.link-primary:hover {
  color: var(--ium-secondary-300) !important;
}

a.navbar-brand {
  padding: 0;
  margin: 0;
}

/* Header mark: the square IUM emblem (Web/img/custom-logo.png), h-11 as
   on the website, beside the application title. */
img.logo {
  display: block;
  height: 2.75rem;
  width: auto;
  max-height: none;
  max-width: 60vw;
  object-fit: contain;
}

nav.navbar.bg-light {
  --bs-navbar-padding-y: 0.25rem;
  --bs-navbar-toggler-border-color: rgb(255, 255, 255, 0.3);
  --bs-navbar-toggler-border-radius: var(--ium-radius);
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");

  background-color: var(--ium-header-bg) !important;
  border-top: 1px solid rgb(255, 255, 255, 0.08);
  border-bottom: 3px solid var(--ium-secondary-500);
  box-shadow: none !important;
}

nav.navbar > .container-fluid {
  padding-inline: 1rem;
}

nav.navbar .navbar-nav {
  gap: 0.125rem;
}

nav.navbar .navbar-nav > .nav-item > .nav-link,
nav.navbar .navbar-nav > .nav-item > .nav-link.link-primary {
  position: relative;
  padding: 0.5rem 0.75rem;
  border-radius: var(--ium-radius);
  color: var(--ium-on-header) !important;
  font-size: 0.875rem;
  font-weight: 600;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

/* Hover/open: white on primary-800 (9.65:1) */
nav.navbar .navbar-nav > .nav-item > .nav-link:hover,
nav.navbar .navbar-nav > .nav-item > .nav-link.show,
nav.navbar .navbar-nav > .nav-item > .nav-link[aria-expanded='true'] {
  color: #ffffff !important;
  background-color: var(--ium-primary-800);
}

nav.navbar .navbar-nav .nav-link i,
nav.navbar .navbar-nav .nav-link .bi {
  color: inherit !important;
}

nav.navbar .dropdown-toggle::after {
  color: var(--ium-primary-300);
  vertical-align: 0.15em;
}

nav.navbar .nav-link.show.dropdown-toggle::after {
  color: var(--ium-secondary-300);
}

/* Active item: white on primary-900 (11.66:1) with a gold underline.
   Upstream markup has no active class, so the current page wrapper picks it. */
body:has(#page-dashboard) #navDashboard > .nav-link,
body:has(#page-schedule, #page-reservation, #page-view-reservation, [id^='page-'][id$='calendar'])
  #navScheduleDropdown
  > .nav-link,
body:has(#page-generate-report, #page-saved-reports, #page-common-reports) #navReportsDropdown > .nav-link,
body:has(
    .admin-page,
    #page-manage-reservations,
    #page-manage-blackouts,
    #page-manage-quotas,
    #page-manage-schedules,
    #page-manage-resources,
    #page-manage-accessories,
    #page-manage-users,
    #page-manage-groups,
    #page-manage-announcements,
    #page-manage-attributes
  )
  #navApplicationManagementDropdown
  > .nav-link {
  color: #ffffff !important;
  background-color: var(--ium-primary-900);
}

body:has(#page-dashboard) #navDashboard > .nav-link::before,
body:has(#page-schedule, #page-reservation, #page-view-reservation, [id^='page-'][id$='calendar'])
  #navScheduleDropdown
  > .nav-link::before,
body:has(#page-generate-report, #page-saved-reports, #page-common-reports) #navReportsDropdown > .nav-link::before,
body:has(
    .admin-page,
    #page-manage-reservations,
    #page-manage-blackouts,
    #page-manage-quotas,
    #page-manage-schedules,
    #page-manage-resources,
    #page-manage-accessories,
    #page-manage-users,
    #page-manage-groups,
    #page-manage-announcements,
    #page-manage-attributes
  )
  #navApplicationManagementDropdown
  > .nav-link::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.2rem;
  height: 2px;
  border-radius: 1px;
  background-color: var(--ium-secondary-400);
}

.badge-new-version {
  background-color: var(--ium-secondary-500) !important;
  color: var(--ium-on-secondary) !important;
}

@media (max-width: 991.98px) {
  nav.navbar .navbar-collapse {
    padding-block: 0.5rem;
  }

  nav.navbar .navbar-nav > .nav-item > .nav-link::before {
    display: none;
  }

  /* Collapsed (mobile) menu: submenus open inline on the green band, so
     they use light text on primary-950/900 instead of white popups. */
  nav.navbar .navbar-nav .dropdown-menu {
    --bs-dropdown-bg: transparent;
    --bs-dropdown-link-color: var(--ium-on-header);
    --bs-dropdown-link-hover-color: #ffffff;
    --bs-dropdown-link-hover-bg: var(--ium-primary-800);
    --bs-dropdown-link-active-color: #ffffff;
    --bs-dropdown-link-active-bg: var(--ium-primary-800);
    --bs-dropdown-divider-bg: rgb(255, 255, 255, 0.15);
    --bs-dropdown-header-color: var(--ium-secondary-300);

    background-color: transparent;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--ium-secondary-500);
    border-radius: 0;
    margin-left: 0.75rem;
  }

  nav.navbar .navbar-nav .dropdown-menu .dropdown-item,
  nav.navbar .navbar-nav .dropdown-menu .dropdown-item i,
  nav.navbar .navbar-nav .dropdown-menu .dropdown-item .bi {
    color: var(--ium-on-header) !important;
  }

  nav.navbar .navbar-nav .dropdown-menu .dropdown-item:hover,
  nav.navbar .navbar-nav .dropdown-menu .dropdown-item:focus {
    color: #ffffff !important;
    background-color: var(--ium-primary-800) !important;
  }
}

@media (max-width: 575.98px) {
  img.logo {
    height: 2.25rem;
  }

  body > div.d-flex:has(> a.navbar-brand) h5 {
    font-size: 0.9375rem;
  }
}

/* ---------------------------------------------------------------------------
 * 5. Dropdowns and menus (websitebeta mega-menu links)
 * ------------------------------------------------------------------------- */
.dropdown-menu {
  --bs-dropdown-font-size: 0.875rem;
  --bs-dropdown-color: var(--ium-sand-800);
  --bs-dropdown-bg: #ffffff;
  --bs-dropdown-border-color: var(--ium-border);
  --bs-dropdown-border-radius: var(--ium-radius);
  --bs-dropdown-link-color: var(--ium-sand-800);
  --bs-dropdown-link-hover-color: var(--ium-primary-700);
  --bs-dropdown-link-hover-bg: var(--ium-primary-50);
  --bs-dropdown-link-active-color: var(--ium-primary-700);
  --bs-dropdown-link-active-bg: var(--ium-primary-100);
  --bs-dropdown-divider-bg: var(--ium-border);
  --bs-dropdown-padding-x: 0.375rem;
  --bs-dropdown-item-padding-x: 0.625rem;
  --bs-dropdown-item-padding-y: 0.375rem;
  --bs-dropdown-item-border-radius: var(--ium-radius);

  font-size: 0.875rem;
  box-shadow: var(--ium-shadow-soft);
}

.dropdown-item {
  font-weight: 500;
  border-radius: var(--ium-radius);
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item:focus-visible {
  color: var(--ium-primary-700);
  background-color: var(--ium-primary-50);
}

.dropdown-item.active,
.dropdown-item:active {
  color: var(--ium-primary-700);
  background-color: var(--ium-primary-100);
}

/* ---------------------------------------------------------------------------
 * 6. Cards, accordions, modals, tables
 * ------------------------------------------------------------------------- */
#main {
  padding-top: 0.5rem;
  padding-inline: 1rem;
}

.card,
.accordion-item,
.modal-content,
.list-group {
  --bs-card-border-color: var(--ium-border);
  --bs-card-cap-bg: #ffffff;
  --bs-card-border-radius: var(--ium-radius);
  --bs-card-inner-border-radius: var(--ium-radius);

  border: 1px solid var(--ium-border);
  border-radius: var(--ium-radius);
  background-color: var(--ium-surface);
}

.card,
.accordion-item {
  box-shadow: var(--ium-shadow-card) !important;
}

/* Cards nested in a card stay flat */
.card .card,
.card .default-box {
  box-shadow: none !important;
}

.card-header {
  background-color: #ffffff;
  border-bottom-color: var(--ium-border);
  font-weight: 600;
}

.card-footer {
  background-color: var(--ium-sand-50);
  border-top-color: var(--ium-border);
}

.accordion {
  --bs-accordion-border-color: var(--ium-border);
  --bs-accordion-border-radius: var(--ium-radius);
  --bs-accordion-inner-border-radius: var(--ium-radius);
  --bs-accordion-btn-focus-box-shadow: var(--ium-focus-ring);
  --bs-accordion-active-bg: #ffffff;
  --bs-accordion-active-color: var(--ium-sand-900);
}

.accordion-item:not(:first-of-type) {
  border-top: 1px solid var(--ium-border);
}

/* Accordion headers (dashboard widgets, filters, reports): white with a
   sand-900 title and a gold bar, like the website's section headings. */
.accordion-header,
.accordion-header:hover,
.accordion-header:has(.accordion-icon-container.collapsed),
.accordion-button,
.accordion-button.collapsed,
.accordion-button:not(.collapsed),
.accordion-button:hover {
  background: #ffffff !important;
  color: var(--ium-sand-900) !important;
}

.accordion-button {
  font-weight: 700;
  box-shadow: none;
}

.accordion-button:not(.collapsed) {
  box-shadow: inset 0 -1px 0 var(--ium-border);
}

.accordion-button:hover {
  background: var(--ium-sand-50) !important;
}

.accordion-header {
  position: relative;
}

.accordion-header::before {
  content: '';
  position: absolute;
  top: 0.9rem;
  bottom: 0.9rem;
  left: 0;
  width: 3px;
  background-color: var(--ium-secondary-500);
  z-index: 4;
  pointer-events: none;
}

.dashboardHeader .badge,
.accordion-button .badge {
  background-color: var(--ium-primary-100) !important;
  color: var(--ium-primary-700) !important;
  font-weight: 700;
}

/* Dashboard day groups ("Today (1)"): sand instead of Bootstrap yellow */
.timespan,
.timespan.bg-warning {
  background-color: var(--ium-sand-100) !important;
  color: var(--ium-sand-700);
  border-bottom-color: var(--ium-border) !important;
  border-left: 3px solid var(--ium-secondary-500);
  padding-left: 0.5rem !important;
}

.upcomingReservationsDashboard .reservation.hover {
  background-color: var(--ium-primary-50);
  color: var(--ium-sand-900);
}

.upcomingReservationsDashboard .reservation.clicked {
  background-color: var(--ium-primary-100);
}

.upcomingReservationsDashboard .reservation.pending {
  background-color: var(--ium-secondary-50);
  box-shadow: inset 3px 0 0 var(--ium-secondary-500);
}

.upcomingReservationsDashboard .reservation.pending.hover,
.upcomingReservationsDashboard .reservation.pending.clicked {
  background-color: var(--ium-secondary-100);
}

.modal {
  --bs-modal-border-color: var(--ium-border);
  --bs-modal-border-radius: var(--ium-radius);
  --bs-modal-inner-border-radius: var(--ium-radius);
  --bs-modal-box-shadow: var(--ium-shadow-soft);
  --bs-modal-header-border-color: var(--ium-border);
  --bs-modal-footer-border-color: var(--ium-border);
  --bs-modal-footer-bg: var(--ium-sand-50);
}

.modal-content {
  box-shadow: var(--ium-shadow-soft);
}

.modal-header {
  border-top: 3px solid var(--ium-secondary-500);
}

.modal-title {
  font-weight: 700;
}

.modal-backdrop {
  --bs-backdrop-bg: var(--ium-primary-950);
  --bs-backdrop-opacity: 0.55;
}

.table {
  --bs-table-color: var(--ium-sand-900);
  --bs-table-bg: #ffffff;
  --bs-table-border-color: var(--ium-border);
  --bs-table-striped-color: var(--ium-sand-900);
  --bs-table-striped-bg: var(--ium-sand-50);
  --bs-table-hover-color: var(--ium-sand-900);
  --bs-table-hover-bg: var(--ium-primary-50);
  --bs-table-active-bg: var(--ium-primary-100);
}

.table > thead > tr > th,
.table > thead > tr > td,
table.dataTable > thead > tr > th {
  background-color: var(--ium-sand-100);
  color: var(--ium-sand-800);
  font-size: 0.8125rem;
  font-weight: 700;
  border-bottom: 1px solid var(--ium-sand-300);
}

.table-warning,
.table > :not(caption) > .table-warning > * {
  --bs-table-color: var(--ium-sand-900);
  --bs-table-bg: var(--ium-secondary-50);
  --bs-table-striped-bg: var(--ium-secondary-50);
  --bs-table-hover-bg: var(--ium-secondary-100);
  --bs-table-border-color: var(--ium-secondary-200);
}

.table-success,
.table > :not(caption) > .table-success > * {
  --bs-table-color: var(--ium-sand-900);
  --bs-table-bg: var(--ium-primary-50);
}

.table-danger,
.table > :not(caption) > .table-danger > * {
  --bs-table-color: var(--ium-sand-900);
  --bs-table-bg: var(--ium-error-50);
}

.list-group {
  --bs-list-group-border-color: var(--ium-border);
  --bs-list-group-active-bg: var(--ium-primary-600);
  --bs-list-group-active-border-color: var(--ium-primary-600);
  --bs-list-group-action-hover-bg: var(--ium-primary-50);
  --bs-list-group-action-hover-color: var(--ium-primary-700);
}

.list-group.list-group-flush {
  border: 0;
}

/* DataTables (admin lists) */
div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button.current:hover {
  background: var(--ium-primary-600) !important;
  border-color: var(--ium-primary-600) !important;
  color: var(--ium-on-primary) !important;
}

div.dt-container .dt-input {
  border-color: var(--ium-sand-300);
  border-radius: var(--ium-radius);
}

div.dt-buttons > .btn,
div.dt-buttons > .dt-button,
div.dt-buttons .btn-secondary {
  --bs-btn-color: var(--ium-primary-600);
  --bs-btn-bg: #ffffff;
  --bs-btn-border-color: var(--ium-primary-600);
  --bs-btn-hover-color: var(--ium-primary-700);
  --bs-btn-hover-bg: var(--ium-primary-50);
  --bs-btn-hover-border-color: var(--ium-primary-700);
  --bs-btn-active-color: var(--ium-on-primary);
  --bs-btn-active-bg: var(--ium-primary-700);
  --bs-btn-active-border-color: var(--ium-primary-700);
}

/* ---------------------------------------------------------------------------
 * 7. Buttons (Guide section 10)
 * ------------------------------------------------------------------------- */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: var(--ium-radius);
  --bs-btn-border-radius-sm: var(--ium-radius);
  --bs-btn-border-radius-lg: var(--ium-radius);

  border-radius: var(--ium-radius);
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

/* Primary: primary-600 fill, white text, hover primary-700 */
.btn-primary,
.btn-success {
  --bs-btn-color: var(--ium-on-primary);
  --bs-btn-bg: var(--ium-primary-600);
  --bs-btn-border-color: var(--ium-primary-600);
  --bs-btn-hover-color: var(--ium-on-primary);
  --bs-btn-hover-bg: var(--ium-primary-700);
  --bs-btn-hover-border-color: var(--ium-primary-700);
  --bs-btn-active-color: var(--ium-on-primary);
  --bs-btn-active-bg: var(--ium-primary-800);
  --bs-btn-active-border-color: var(--ium-primary-800);
  --bs-btn-disabled-color: var(--ium-primary-700);
  --bs-btn-disabled-bg: var(--ium-primary-100);
  --bs-btn-disabled-border-color: var(--ium-primary-100);
  --bs-btn-focus-shadow-rgb: 207, 153, 15;
}

/* Accent: gold fill with primary-950 text (never white on gold) */
.btn-warning,
.btn-accent {
  --bs-btn-color: var(--ium-on-secondary);
  --bs-btn-bg: var(--ium-secondary-500);
  --bs-btn-border-color: var(--ium-secondary-500);
  --bs-btn-hover-color: var(--ium-on-secondary);
  --bs-btn-hover-bg: var(--ium-secondary-400);
  --bs-btn-hover-border-color: var(--ium-secondary-400);
  --bs-btn-active-color: var(--ium-on-secondary);
  --bs-btn-active-bg: var(--ium-secondary-400);
  --bs-btn-active-border-color: var(--ium-secondary-400);
  --bs-btn-disabled-color: var(--ium-secondary-800);
  --bs-btn-disabled-bg: var(--ium-secondary-100);
  --bs-btn-disabled-border-color: var(--ium-secondary-100);
}

/* Ghost / outline: primary-600 border and text, hover primary-50 fill */
.btn-outline-primary,
.btn-outline-success {
  --bs-btn-color: var(--ium-primary-600);
  --bs-btn-bg: #ffffff;
  --bs-btn-border-color: var(--ium-primary-600);
  --bs-btn-hover-color: var(--ium-primary-700);
  --bs-btn-hover-bg: var(--ium-primary-50);
  --bs-btn-hover-border-color: var(--ium-primary-700);
  --bs-btn-active-color: var(--ium-on-primary);
  --bs-btn-active-bg: var(--ium-primary-700);
  --bs-btn-active-border-color: var(--ium-primary-700);
  --bs-btn-disabled-color: var(--ium-primary-700);
  --bs-btn-disabled-bg: #ffffff;
  --bs-btn-disabled-border-color: var(--ium-primary-200);
}

.btn-check:checked + .btn-outline-primary,
.btn-outline-primary.active {
  color: var(--ium-on-primary);
  background-color: var(--ium-primary-600);
  border-color: var(--ium-primary-600);
}

/* Neutral buttons (Cancel, Reset) */
.btn-secondary,
.btn-outline-secondary,
.btn-light,
.btn-default {
  --bs-btn-color: var(--ium-sand-700);
  --bs-btn-bg: #ffffff;
  --bs-btn-border-color: var(--ium-sand-300);
  --bs-btn-hover-color: var(--ium-sand-900);
  --bs-btn-hover-bg: var(--ium-sand-100);
  --bs-btn-hover-border-color: var(--ium-sand-400);
  --bs-btn-active-color: var(--ium-sand-900);
  --bs-btn-active-bg: var(--ium-sand-200);
  --bs-btn-active-border-color: var(--ium-sand-400);
  --bs-btn-disabled-color: var(--ium-sand-600);
  --bs-btn-disabled-bg: var(--ium-sand-100);
  --bs-btn-disabled-border-color: var(--ium-sand-200);
}

.btn-danger {
  --bs-btn-bg: var(--ium-error-700);
  --bs-btn-border-color: var(--ium-error-700);
  --bs-btn-hover-bg: #912018;
  --bs-btn-hover-border-color: #912018;
  --bs-btn-active-bg: #7a1a13;
  --bs-btn-active-border-color: #7a1a13;
}

.btn-outline-danger {
  --bs-btn-color: var(--ium-error-700);
  --bs-btn-border-color: var(--ium-error-700);
  --bs-btn-hover-bg: var(--ium-error-700);
  --bs-btn-hover-border-color: var(--ium-error-700);
  --bs-btn-active-bg: var(--ium-error-700);
}

.btn-link {
  --bs-btn-color: var(--ium-primary-600);
  --bs-btn-hover-color: var(--ium-primary-700);
  --bs-btn-active-color: var(--ium-primary-700);
  font-weight: 600;
}

/* librebooking.css paints every disabled button in --primary-disabled;
   keep each variant's own disabled colours instead. */
.btn.disabled,
.btn:disabled,
fieldset:disabled .btn {
  color: var(--bs-btn-disabled-color);
  background-color: var(--bs-btn-disabled-bg);
  border-color: var(--bs-btn-disabled-border-color);
  opacity: 1;
}

.reserveButton .btn {
  color: var(--ium-on-primary);
}

.link-primary {
  color: var(--ium-primary-600) !important;
}

.link-primary:hover,
.link-primary:focus {
  color: var(--ium-primary-700) !important;
}

/* ---------------------------------------------------------------------------
 * 8. Forms
 * ------------------------------------------------------------------------- */
.form-control,
.form-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  border-color: var(--ium-sand-300);
  border-radius: var(--ium-radius);
  color: var(--ium-sand-900);
  background-color: #ffffff;
}

.form-control::placeholder {
  color: var(--ium-sand-600);
  opacity: 1;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--ium-primary-600);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
  background-color: var(--ium-sand-100);
}

.input-group-text {
  border-color: var(--ium-sand-300);
  border-radius: var(--ium-radius);
  background-color: var(--ium-sand-100);
  color: var(--ium-sand-700);
}

label,
.form-label,
.col-form-label {
  font-weight: 600;
  color: var(--ium-sand-800);
}

.form-check-input {
  border-color: var(--ium-sand-400);
}

.form-check-input:checked,
.form-check-input.is-valid:checked,
.was-validated .form-check-input:valid:checked {
  background-color: var(--ium-primary-600);
  border-color: var(--ium-primary-600);
}

.form-switch .form-check-input:focus:not(:checked) {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23a9a091'/%3e%3c/svg%3e");
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--ium-primary-600);
  color: var(--ium-on-primary);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: var(--ium-primary-50);
  border-color: var(--ium-primary-200);
  color: var(--ium-primary-800);
}

/* ---------------------------------------------------------------------------
 * 9. Alerts, badges, pagination, toasts (Guide section 7 status colours)
 * ------------------------------------------------------------------------- */
.alert {
  --bs-alert-border-radius: var(--ium-radius);

  border-left-width: 4px;
}

.alert-success {
  --bs-alert-color: var(--ium-primary-700);
  --bs-alert-bg: var(--ium-primary-50);
  --bs-alert-border-color: var(--ium-primary-200);
  --bs-alert-link-color: var(--ium-primary-800);

  border-left-color: var(--ium-primary-600);
}

.alert-info,
.alert-primary {
  --bs-alert-color: var(--ium-lagoon-700);
  --bs-alert-bg: var(--ium-lagoon-50);
  --bs-alert-border-color: var(--ium-lagoon-100);
  --bs-alert-link-color: var(--ium-lagoon-900);

  border-left-color: var(--ium-lagoon-500);
}

.alert-warning {
  --bs-alert-color: var(--ium-warning-700);
  --bs-alert-bg: var(--ium-warning-50);
  --bs-alert-border-color: #f9dbaf;
  --bs-alert-link-color: #93370d;

  border-left-color: var(--ium-warning-700);
}

.alert-danger {
  --bs-alert-color: var(--ium-error-700);
  --bs-alert-bg: var(--ium-error-50);
  --bs-alert-border-color: #fecdca;
  --bs-alert-link-color: #912018;

  border-left-color: var(--ium-error-700);
}

.badge {
  border-radius: var(--ium-radius);
  font-weight: 600;
}

.badge.bg-primary,
.badge.text-bg-primary {
  background-color: var(--ium-primary-600) !important;
  color: var(--ium-on-primary) !important;
}

.badge.bg-secondary,
.badge.text-bg-secondary {
  background-color: var(--ium-sand-200) !important;
  color: var(--ium-sand-800) !important;
}

.badge.bg-warning,
.badge.text-bg-warning {
  background-color: var(--ium-secondary-500) !important;
  color: var(--ium-on-secondary) !important;
}

.badge.bg-info,
.badge.text-bg-info {
  background-color: var(--ium-lagoon-700) !important;
  color: #ffffff !important;
}

.badge.bg-danger,
.badge.text-bg-danger {
  background-color: var(--ium-error-700) !important;
  color: #ffffff !important;
}

.badge.bg-success,
.badge.text-bg-success {
  background-color: var(--ium-primary-700) !important;
  color: #ffffff !important;
}

.pagination {
  --bs-pagination-color: var(--ium-primary-700);
  --bs-pagination-bg: #ffffff;
  --bs-pagination-border-color: var(--ium-border);
  --bs-pagination-border-radius: var(--ium-radius);
  --bs-pagination-hover-color: var(--ium-primary-700);
  --bs-pagination-hover-bg: var(--ium-primary-50);
  --bs-pagination-hover-border-color: var(--ium-primary-200);
  --bs-pagination-focus-color: var(--ium-primary-700);
  --bs-pagination-focus-bg: var(--ium-primary-50);
  --bs-pagination-active-color: var(--ium-on-primary);
  --bs-pagination-active-bg: var(--ium-primary-600);
  --bs-pagination-active-border-color: var(--ium-primary-600);
  --bs-pagination-disabled-color: var(--ium-sand-600);
  --bs-pagination-disabled-bg: var(--ium-sand-100);
  --bs-pagination-disabled-border-color: var(--ium-border);
}

.page-link,
.disabled > .page-link {
  color: var(--bs-pagination-color);
  border: 1px solid var(--ium-border);
}

.page-link:hover {
  color: var(--ium-primary-700);
  background-color: var(--ium-primary-50);
  border-color: var(--ium-primary-200);
}

.page-link:focus {
  color: var(--ium-primary-700) !important;
}

.disabled > .page-link,
.page-link.disabled {
  color: var(--ium-sand-600);
  background-color: var(--ium-sand-100);
}

.active > .page-link,
.page-link.active {
  color: var(--ium-on-primary);
  background-color: var(--ium-primary-600);
  border-color: var(--ium-primary-600);
}

.toast.bg-primary {
  background-color: var(--ium-primary-600) !important;
}

#button-up {
  background-color: var(--ium-primary-600) !important;
  box-shadow: var(--ium-shadow-soft);
}

.carousel-indicators [data-bs-target] {
  background-color: var(--ium-primary-600);
}

.nav-tabs {
  --bs-nav-tabs-border-color: var(--ium-border);
  --bs-nav-tabs-link-active-color: var(--ium-primary-700);
  --bs-nav-tabs-link-active-border-color: var(--ium-border) var(--ium-border) #ffffff;
  --bs-nav-link-color: var(--ium-sand-700);
  --bs-nav-link-hover-color: var(--ium-primary-700);
}

.nav-tabs .nav-link.active {
  box-shadow: inset 0 2px 0 var(--ium-secondary-500);
}

.nav-pills {
  --bs-nav-pills-link-active-bg: var(--ium-primary-600);
  --bs-nav-pills-link-active-color: var(--ium-on-primary);
}

/* ---------------------------------------------------------------------------
 * 10. Footer: primary-950 band, primary-200 text, white logo, star motif.
 * The LibreBooking GPLv3 notice stays visible (GPLv3 section 5(d)).
 * ------------------------------------------------------------------------- */
footer[role='contentinfo'],
footer.bg-light {
  position: relative;
  margin-top: auto;
  padding: 2.25rem 1rem 1.25rem !important;
  background-color: var(--ium-footer-bg) !important;
  background-image: var(--ium-star-pattern);
  color: var(--ium-on-footer);
  border-top: 0 !important;
  font-size: 0.875rem;
}

footer[role='contentinfo']::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background-image: var(--ium-gold-rule);
}

footer[role='contentinfo']::after {
  content: '';
  display: block;
  order: -1;
  width: 10rem;
  height: 3.0625rem;
  margin: 0 auto 1rem;
  background: url('../img/ium-logo-white.png') center / contain no-repeat;
}

footer[role='contentinfo'] {
  display: flex;
  flex-direction: column;
  align-items: center;
}

footer[role='contentinfo'] a.link-primary,
footer[role='contentinfo'] a {
  color: var(--ium-on-footer) !important;
  text-decoration: none;
}

footer[role='contentinfo'] a:hover,
footer[role='contentinfo'] a:focus-visible {
  color: var(--ium-secondary-300) !important;
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
 * 11. Login: primary-950 band with the star motif, logo centred on a
 * clean white card (websitebeta page-header)
 * ------------------------------------------------------------------------- */
body:has(#page-login) #main {
  position: relative;
  isolation: isolate;
  margin-top: 0 !important;
  padding-top: 1px;
}

body:has(#page-login) #main::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 15rem;
  z-index: -1;
  background-color: var(--ium-primary-950);
  background-image: radial-gradient(circle at 85% 0%, rgb(15, 79, 45, 0.6), transparent 45%), var(--ium-star-pattern);
  border-bottom: 4px solid var(--ium-secondary-500);
}

#page-login > .col-md-6 {
  max-width: 28rem;
  margin-top: 3rem !important;
}

#page-login .card {
  border: 1px solid var(--ium-border);
  box-shadow: var(--ium-shadow-soft) !important;
}

#page-login .card-body {
  padding: 1.5rem 0.5rem 0.5rem;
}

/* Login logo. LibreBooking renders the same custom-logo.* here as in the
   header. When that is the committed emblem (src img/custom-logo.png), the
   full colour lockup with the titles (Web/img/ium-logo-full.png) is shown
   instead as a background; the <img> stays in the page, visually hidden,
   so screen readers still get its alt text. A logo uploaded in Look and
   Feel is served from the upload directory, does not match, and shows
   as uploaded (centred, up to 7.5rem tall). */
#page-login .login-icon img {
  width: auto !important;
  max-width: 100%;
  height: auto;
  max-height: 7.5rem;
  object-fit: contain;
  margin-bottom: 1rem;
}

#page-login .login-icon:has(img[src^='img/custom-logo.'], img[src*='/img/custom-logo.']) {
  height: 5.5rem;
  margin-bottom: 1.25rem !important;
  background: url('../img/ium-logo-full.png') center / contain no-repeat;
}

#page-login .login-icon img:is([src^='img/custom-logo.'], [src*='/img/custom-logo.']) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#page-login .social-login {
  padding-top: 1rem;
  border-top: 1px solid var(--ium-border);
}

#page-login .social-login .btn {
  min-width: 100%;
  padding-block: 0.625rem;
  background-color: #ffffff;
  border-color: var(--ium-sand-300);
  color: var(--ium-sand-800);
}

#page-login .social-login .btn:hover {
  background-color: var(--ium-primary-50);
  border-color: var(--ium-primary-600);
  color: var(--ium-primary-700);
}

#page-login .social-login .bi-google {
  color: var(--ium-primary-600);
}

#page-login #announcements {
  margin-top: 2rem !important;
}

/* ---------------------------------------------------------------------------
 * 12. Schedule grid (Schedule > Bookings)
 * Every slot state has its own fill and a text colour that passes AA:
 *   available     white                      (no text)
 *   reserved      primary-700, white         7.33:1
 *   mine          secondary-500, primary-950 6.40:1
 *   participating lagoon-700, white          5.95:1
 *   pending       secondary-100, secondary-800 6.36:1, dashed gold border
 *   blocked       sand-200, sand-800         10.34:1
 *   restricted    sand-100/sand-300 hatch, sand-900
 *   past slot     sand-100
 *   past booking  sand-100, sand-700 8.37:1, with the state colour as a bar
 * ------------------------------------------------------------------------- */
table.reservations {
  font-size: 0.8125rem;
  background-color: #ffffff;
}

table.reservations td {
  border-color: var(--color-lines);
}

table.reservations td.resdate {
  background-color: var(--ium-primary-900);
  color: #ffffff;
  font-weight: 600;
}

table.reservations tr.today td.resdate,
table.reservations td.today {
  background-color: var(--ium-secondary-400);
  color: var(--ium-primary-950);
}

table.reservations td.reslabel {
  background-color: var(--ium-sand-100);
  color: var(--ium-sand-700);
  font-weight: 500;
}

table.reservations tr.today td.reslabel {
  background-color: var(--ium-secondary-100);
  color: var(--ium-sand-800);
}

table.reservations td.resourcename {
  padding-left: 0.5rem;
  background-color: var(--ium-primary-50);
  color: var(--ium-primary-700);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--ium-primary-600);
}

table.reservations td.resourcename a {
  color: var(--ium-primary-700);
}

table.reservations td.resourcename.hilite,
table.reservations td.resourcename:hover {
  background-color: var(--ium-primary-100);
}

table.reservations td.resourcename.hilite a,
table.reservations td.resourcename a:hover {
  color: var(--ium-primary-800);
}

td.reservable,
div.reservable {
  background-color: var(--reservable);
}

.reservable.hilite,
#reservations .ui-selecting,
.reservable.clicked,
#reservations .ui-selected {
  background-color: var(--ium-primary-200);
  color: var(--ium-primary-950);
}

.unreservable,
.buffer {
  background-color: var(--ium-sand-200);
  color: var(--ium-sand-800);
}

.pasttime {
  background-color: var(--ium-sand-100);
}

.restricted {
  background: repeating-linear-gradient(
    45deg,
    var(--ium-sand-100),
    var(--ium-sand-100) 6px,
    var(--ium-sand-300) 6px,
    var(--ium-sand-300) 8px
  );
  color: var(--ium-sand-900);
}

.event,
.condensed-event {
  border-radius: var(--ium-radius);
  font-weight: 600;
  line-height: 1.3;
}

.reserved {
  background-color: var(--ium-primary-700);
  color: #ffffff;
}

.reserved.hilite {
  background-color: var(--ium-primary-800);
  color: #ffffff;
}

.reserved.clicked {
  background-color: var(--ium-primary-900);
  color: #ffffff;
}

.reserved.mine {
  background-color: var(--ium-secondary-500);
  color: var(--ium-primary-950);
}

.reserved.mine.hilite,
.reserved.mine.clicked {
  background-color: var(--ium-secondary-400);
  color: var(--ium-primary-950);
}

.reserved.participating {
  background-color: var(--ium-lagoon-700);
  color: #ffffff;
}

.reserved.participating.hilite,
.reserved.participating.clicked {
  background-color: var(--ium-lagoon-900);
  color: #ffffff;
}

.reserved.pending {
  background-color: var(--ium-secondary-100);
  color: var(--ium-secondary-800);
  border: 1px dashed var(--ium-secondary-600);
}

.reserved.pending.hilite,
.reserved.pending.clicked {
  background-color: var(--ium-secondary-200);
  color: var(--ium-secondary-800);
}

/* Past bookings: muted sand fill, state kept as a left bar */
.past,
.reserved.past,
.reserved.mine.past,
.reserved.participating.past,
.reserved.pending.past {
  background-color: var(--ium-sand-100);
  color: var(--ium-sand-700);
  box-shadow: inset 4px 0 0 var(--ium-primary-700);
}

.reserved.mine.past {
  box-shadow: inset 4px 0 0 var(--ium-secondary-500);
}

.reserved.participating.past {
  box-shadow: inset 4px 0 0 var(--ium-lagoon-700);
}

.reserved.pending.past {
  box-shadow: inset 4px 0 0 var(--ium-secondary-600);
}

.reserved.past.hilite {
  background-color: var(--ium-sand-200);
  color: var(--ium-sand-800);
}

.res_popup_details .pendingApproval {
  color: var(--ium-secondary-800);
}

/* Legend: same fills as the grid, sized to the label */
div.legend {
  width: auto;
  min-width: 90px;
  padding-inline: 0.75rem;
  border-color: var(--ium-sand-300) !important;
  border-radius: var(--ium-radius) !important;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ium-sand-800);
}

div.legend.reserved {
  color: #ffffff;
  border-color: var(--ium-primary-700) !important;
}

div.legend.reserved.mine {
  color: var(--ium-primary-950);
  border-color: var(--ium-secondary-500) !important;
}

div.legend.reserved.participating {
  color: #ffffff;
  border-color: var(--ium-lagoon-700) !important;
}

div.legend.reserved.pending {
  color: var(--ium-secondary-800);
  border: 1px dashed var(--ium-secondary-600) !important;
}

div.legend.pasttime,
div.legend.unreservable {
  color: var(--ium-sand-800);
}

div.legend.restricted {
  color: var(--ium-sand-900);
}

/* Date navigation and view switcher */
.schedule-dates {
  align-items: center;
  font-weight: 700;
  color: var(--ium-sand-900);
}

.schedule-dates .change-date {
  color: var(--ium-primary-600) !important;
}

.schedule-dates .change-date:hover {
  color: var(--ium-primary-700) !important;
}

.schedule-style img {
  border-radius: var(--ium-radius);
}

.schedule-style.active {
  border-bottom-color: var(--ium-secondary-500);
}

/* Resource filter panel */
#reservations-left .card {
  border-color: var(--ium-border);
}

#reservations-left .reservations-left-header {
  background-color: #ffffff;
  color: var(--ium-sand-900);
  border-bottom: 1px solid var(--ium-border);
  box-shadow: inset 3px 0 0 var(--ium-secondary-500);
}

#reservations-left .reservations-left-header .card-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#reservations-left .reservations-left-header a,
#reservations-left .reservations-left-header i {
  color: var(--ium-sand-600) !important;
}

/* Condensed week and mobile views */
table.reservations.mobile div.reservable,
.reservations.condensed div.reservable {
  border: 1px dashed var(--ium-sand-400);
  color: var(--ium-sand-700);
  background-color: #ffffff;
}

.reservations.condensed div.reservable:hover {
  background-color: var(--ium-primary-50);
}

#reservations .mobile .resdate {
  background-color: var(--ium-primary-900);
  color: #ffffff;
}

#reservations .mobile td.today {
  background-color: var(--ium-secondary-400);
  color: var(--ium-primary-950);
}

.reservation-new {
  background-color: var(--ium-primary-100);
  color: var(--ium-primary-800);
}

.reservation-updated {
  background-color: var(--ium-sand-200);
  color: var(--ium-sand-800);
}

/* ---------------------------------------------------------------------------
 * 13. Date pickers (flatpickr)
 * ------------------------------------------------------------------------- */
.flatpickr-calendar {
  border-radius: var(--ium-radius);
  box-shadow: var(--ium-shadow-soft);
  font-family: var(--ium-font);
}

.flatpickr-months .flatpickr-month,
.flatpickr-monthDropdown-months {
  background: var(--ium-primary-700) !important;
  color: #ffffff !important;
}

.flatpickr-calendar.arrowTop::after {
  border-bottom-color: var(--ium-primary-700);
}

.flatpickr-weekdays,
span.flatpickr-weekday {
  background: var(--ium-primary-50) !important;
  color: var(--ium-primary-800) !important;
  font-weight: 600;
}

.flatpickr-day {
  color: var(--ium-sand-900);
  border-radius: var(--ium-radius);
}

.flatpickr-day:hover,
.flatpickr-day:focus,
.flatpickr-day.inRange {
  background: var(--ium-primary-50);
  border-color: var(--ium-primary-100);
}

.flatpickr-day.today {
  border-color: var(--ium-secondary-500) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
  background: var(--ium-primary-600) !important;
  border-color: var(--ium-primary-600) !important;
  color: #ffffff !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: var(--ium-sand-400);
}

/* ---------------------------------------------------------------------------
 * 14. FullCalendar 6 (My Calendar, Resource Calendar)
 * ------------------------------------------------------------------------- */
.fc {
  --fc-border-color: var(--ium-border);
  --fc-today-bg-color: var(--ium-secondary-50);
  --fc-page-bg-color: #ffffff;
  --fc-neutral-bg-color: var(--ium-sand-100);
  --fc-list-event-hover-bg-color: var(--ium-primary-50);
  --fc-event-bg-color: var(--ium-primary-700);
  --fc-event-border-color: var(--ium-primary-700);
  --fc-event-text-color: #ffffff;
  --fc-button-text-color: #ffffff;
  --fc-button-bg-color: var(--ium-primary-600);
  --fc-button-border-color: var(--ium-primary-600);
  --fc-button-hover-bg-color: var(--ium-primary-700);
  --fc-button-hover-border-color: var(--ium-primary-700);
  --fc-button-active-bg-color: var(--ium-primary-800);
  --fc-button-active-border-color: var(--ium-primary-800);
}

.fc .fc-scrollgrid {
  background-color: #ffffff;
  border-radius: var(--ium-radius);
}

.fc .fc-toolbar-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ium-sand-900);
}

.fc .fc-button {
  font-weight: 600;
  border-radius: var(--ium-radius);
}

.fc .fc-button-primary {
  background-color: var(--ium-primary-600) !important;
  border-color: var(--ium-primary-600) !important;
  color: #ffffff !important;
}

.fc .fc-button-primary:not(:disabled):hover {
  background-color: var(--ium-primary-700) !important;
  border-color: var(--ium-primary-700) !important;
}

.fc .fc-button-primary:disabled {
  background-color: var(--ium-primary-100) !important;
  border-color: var(--ium-primary-100) !important;
  color: var(--ium-primary-700) !important;
  opacity: 1;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background-color: var(--ium-primary-800) !important;
  border-color: var(--ium-primary-800) !important;
  box-shadow: inset 0 -2px 0 var(--ium-secondary-500);
}

.fc .fc-col-header-cell {
  background-color: var(--ium-sand-100);
}

.fc .fc-col-header-cell-cushion {
  padding: 8px 4px;
  color: var(--ium-sand-800);
  font-weight: 700;
}

.fc .fc-daygrid-day-number {
  color: var(--ium-sand-900);
}

.fc .fc-day-today .fc-daygrid-day-number {
  color: var(--ium-primary-950);
  font-weight: 700;
}

.fc-day-past {
  background-color: var(--ium-sand-100) !important;
}

.fc .fc-event.reserved,
.fc .fc-event.reserved .fc-event-main,
.fc .fc-event.reserved .fc-event-time,
.fc .fc-event.reserved .fc-event-title {
  background-color: var(--ium-primary-700);
  border-color: var(--ium-primary-700);
  color: #ffffff;
}

.fc .fc-event.reserved.mine,
.fc .fc-event.reserved.mine .fc-event-main,
.fc .fc-event.reserved.mine .fc-event-time,
.fc .fc-event.reserved.mine .fc-event-title {
  background-color: var(--ium-secondary-500);
  border-color: var(--ium-secondary-500);
  color: var(--ium-primary-950);
}

.fc .fc-event.reserved.participating,
.fc .fc-event.reserved.participating .fc-event-main,
.fc .fc-event.reserved.participating .fc-event-time,
.fc .fc-event.reserved.participating .fc-event-title {
  background-color: var(--ium-lagoon-700);
  border-color: var(--ium-lagoon-700);
  color: #ffffff;
}

.fc .fc-event.reserved.pending,
.fc .fc-event.reserved.pending .fc-event-main,
.fc .fc-event.reserved.pending .fc-event-time,
.fc .fc-event.reserved.pending .fc-event-title {
  background-color: var(--ium-secondary-100);
  border-color: var(--ium-secondary-600);
  color: var(--ium-secondary-800);
}

.fc .fc-event.reserved .fc-event-main *,
.fc .fc-event.reserved .fc-event-time,
.fc .fc-event.reserved .fc-event-title {
  background-color: transparent;
}

.fc .fc-event.reserved {
  border-radius: var(--ium-radius);
}

.fc-event:hover,
.fc-list-event:hover,
.fc-list-event:hover td {
  background-color: var(--ium-primary-50) !important;
  color: var(--ium-sand-900) !important;
}

.fc .fc-event.reserved:hover .fc-event-main,
.fc .fc-event.reserved:hover .fc-event-time,
.fc .fc-event.reserved:hover .fc-event-title {
  color: var(--ium-sand-900);
}

.fc .fc-list-day-cushion {
  background-color: var(--ium-sand-100);
}

.fc .fc-list-event.reserved td {
  background-color: #ffffff;
  color: var(--ium-sand-900);
}

#dayDialog {
  background-color: #ffffff !important;
  border: 1px solid var(--ium-border);
}

@media (max-width: 575.98px) {
  .fc .fc-toolbar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .fc .fc-toolbar-title {
    font-size: 1.25rem;
  }
}

/* ---------------------------------------------------------------------------
 * 15. Reports
 * ------------------------------------------------------------------------- */
#resultsDiv .table,
#report-results {
  background-color: #ffffff;
}

#page-generate-report .btn-group-sm .btn,
#page-generate-report .btn-check + .btn {
  font-weight: 600;
}

#resultsDiv {
  max-width: 100%;
  overflow-x: auto;
}

/* "Between" date range: let the two date inputs wrap on phones instead of
   pushing the page wider than the screen (upstream overflowed at 390px). */
@media (max-width: 575.98px) {
  #rangeDiv .d-inline-flex {
    flex-wrap: wrap;
    max-width: 100%;
  }

  #rangeDiv .dateinput {
    width: 7.5rem !important;
    min-width: 0;
  }
}
