/*
 * MRBS default theme — refined edition
 * Palette unchanged: blue #005073, deep blue #003b59, yellow #ffd500, ink #193449.
 * This file overrides css/mrbs.css.php and is loaded after it.
 */

/* ------------------------------------------------------------------ */
/* 1. Design tokens                                                    */
/* ------------------------------------------------------------------ */
:root {
  color-scheme: light;

  --mrbs-blue: #005073;
  --mrbs-blue-deep: #003b59;
  --mrbs-blue-soft: #eaf3f7;
  --mrbs-blue-tint: #f4f9fb;
  --mrbs-yellow: #ffd500;
  --mrbs-ink: #193449;
  --mrbs-muted: #64788a;
  --mrbs-line: #d7e3ea;
  --mrbs-line-strong: #c3d3dd;
  --mrbs-surface: #ffffff;
  --mrbs-bg: #f3f7fa;

  --mrbs-ring: 0 0 0 3px rgba(0, 80, 115, 0.16);
  --mrbs-shadow-sm: 0 1px 2px rgba(0, 55, 82, 0.06), 0 2px 8px rgba(0, 55, 82, 0.05);
  --mrbs-shadow: 0 12px 30px rgba(0, 55, 82, 0.09);
  --mrbs-shadow-lg: 0 24px 60px rgba(0, 55, 82, 0.18);

  --mrbs-radius-sm: 0.55rem;
  --mrbs-radius: 0.75rem;
  --mrbs-radius-lg: 1.1rem;

  --mrbs-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --mrbs-fast: 160ms;
  --mrbs-med: 280ms;
  --mrbs-slow: 480ms;

  --mrbs-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23005073' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ */
/* 2. Base                                                             */
/* ------------------------------------------------------------------ */
html {
  scroll-behavior: smooth;
}

body {
  color: var(--mrbs-ink);
  background:
    radial-gradient(ellipse at 12% 0%, rgba(0, 80, 115, 0.09), transparent 34rem),
    radial-gradient(ellipse at 100% 18%, rgba(255, 213, 0, 0.07), transparent 28rem),
    var(--mrbs-bg);
  background-attachment: fixed;
  font-family: "Inter", "Aptos", "Segoe UI", system-ui, -apple-system, "Trebuchet MS", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--mrbs-yellow);
  color: var(--mrbs-blue-deep);
}

a {
  transition: color var(--mrbs-fast) ease, background-color var(--mrbs-fast) ease,
              opacity var(--mrbs-fast) ease;
}

.contents a:not(.new_booking):not(.button):hover {
  color: var(--mrbs-blue);
}

h1, h2, h3 {
  color: var(--mrbs-blue-deep);
  letter-spacing: -0.015em;
}

h1 {
  margin: 1.1rem 0 0.9rem;
  padding-bottom: 0.45rem;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  font-weight: 700;
  border-bottom: 0;
  background: linear-gradient(90deg, var(--mrbs-yellow) 0 3.2rem, rgba(0, 80, 115, 0.16) 3.2rem) bottom / 100% 3px no-repeat;
}

h2 {
  font-weight: 650;
}

h2.date {
  margin-top: 0.7rem;
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

hr {
  border: 0;
  height: 1px;
  background: var(--mrbs-line);
}

/* Slim, on-brand scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--mrbs-line-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--mrbs-line-strong) padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--mrbs-muted) padding-box;
}

/* ------------------------------------------------------------------ */
/* 3. Banner / top navigation                                          */
/* ------------------------------------------------------------------ */
.banner {
  background: linear-gradient(115deg, var(--mrbs-blue-deep), var(--mrbs-blue) 70%);
  border: 0;
  border-bottom: 4px solid var(--mrbs-yellow);
  box-shadow: 0 6px 24px rgba(0, 55, 82, 0.2);
  animation: mrbs-drop-in var(--mrbs-slow) var(--mrbs-ease) backwards;
}

.banner .company {
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.banner .company a {
  transition: opacity var(--mrbs-fast) ease;
}

.banner .company a:hover {
  background: none;
  opacity: 0.85;
}

.banner nav a,
.banner nav.logon input,
.banner nav.logon span {
  position: relative;
  border-radius: 0.7rem;
  transition: background-color var(--mrbs-fast) ease, color var(--mrbs-fast) ease,
              transform var(--mrbs-fast) var(--mrbs-ease);
}

.banner nav a:hover,
.banner nav.logon input:hover {
  background-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.banner nav.menu a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.1rem;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--mrbs-yellow);
  transform: translateX(-50%);
  transition: width var(--mrbs-med) var(--mrbs-ease);
}

.banner nav.menu a:hover::after,
.banner nav.menu a:focus-visible::after {
  width: 55%;
}

/* Logon / logoff buttons must stay "ghost" buttons inside the banner */
.banner nav.logon input[type="submit"],
.banner nav.logon input[type="button"] {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: #ffffff;
  padding: 0.3rem 0.85rem;
}

.banner nav.logon input[type="submit"]:hover,
.banner nav.logon input[type="button"]:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.16);
}

form#show_my_entries input.link[type="submit"],
input.link[type="submit"] {
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
  box-shadow: none;
}

form#show_my_entries input.link[type="submit"]:hover,
input.link[type="submit"]:hover {
  background: none;
  transform: none;
  text-decoration: underline;
}

/* Notification badge */
.banner a.notification {
  min-width: 1.4rem;
  font-weight: 700;
  color: var(--mrbs-blue-deep);
}

.banner a.notification.attention {
  background-color: var(--mrbs-yellow);
  color: var(--mrbs-blue-deep);
  animation: mrbs-pulse 2.4s ease-in-out infinite;
}

/* Header search + go-to-date */
.banner input[type="search"],
.banner #form_nav input[type="date"],
.banner #form_nav input.form-control {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0.4rem 0.95rem;
  transition: background-color var(--mrbs-med) ease, box-shadow var(--mrbs-med) ease,
              width var(--mrbs-med) var(--mrbs-ease);
}

.banner input[type="search"]::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.banner input[type="search"]:focus,
.banner #form_nav input:focus {
  border-color: var(--mrbs-yellow);
  background-color: #ffffff;
  color: var(--mrbs-ink);
  box-shadow: 0 0 0 3px rgba(255, 213, 0, 0.35);
}

.banner input[type="search"]:focus::placeholder {
  color: var(--mrbs-muted);
}

.banner #form_nav input[type="submit"] {
  border-color: var(--mrbs-yellow);
  background: var(--mrbs-yellow);
  color: var(--mrbs-blue-deep);
  font-weight: 650;
}

.banner #form_nav input[type="submit"]:hover {
  border-color: #ffe34d;
  background: #ffe34d;
}

/* ------------------------------------------------------------------ */
/* 4. Page content + fade / stagger entrance                           */
/* ------------------------------------------------------------------ */
.contents {
  padding-top: 0.5rem;
}

/* Each top-level block fades up in sequence.  "backwards" (not "both")
   so no lingering transform is left behind that would trap
   position:fixed / absolutely positioned descendants. */
.contents > * {
  /* Opacity only: a transform here would shift the calendar table while it loads, and
     resizable.js measures the cell positions at that moment (selection boxes then
     end up offset from the real slots). */
  animation: mrbs-fade-in var(--mrbs-slow) var(--mrbs-ease) backwards;
}

.contents > *:nth-child(1) { animation-delay: 40ms; }
.contents > *:nth-child(2) { animation-delay: 100ms; }
.contents > *:nth-child(3) { animation-delay: 160ms; }
.contents > *:nth-child(4) { animation-delay: 220ms; }
.contents > *:nth-child(5) { animation-delay: 280ms; }
.contents > *:nth-child(n+6) { animation-delay: 340ms; }

/* Fade-out when leaving the page (class toggled by theme.js) */
.contents {
  transition: opacity 170ms ease, filter 170ms ease;
}

body.mrbs-leaving .contents {
  opacity: 0;
  filter: blur(2px);
  pointer-events: none;
}

body.mrbs-soft-leaving .contents {
  opacity: 0.35;
  pointer-events: none;
}

/* Calendar table swaps (auto-refresh / AJAX) fade in softly */
table.dwm_main.mrbs-swap tbody,
table.dwm_main.mrbs-swap thead {
  animation: mrbs-soft-in var(--mrbs-med) ease-out;
}

/* ------------------------------------------------------------------ */
/* 5. Calendar navigation bar                                          */
/* ------------------------------------------------------------------ */
nav.main_calendar {
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--mrbs-line);
  border-radius: var(--mrbs-radius-lg);
  background: var(--mrbs-surface);
  box-shadow: var(--mrbs-shadow-sm);
}

nav.view div.container {
  gap: 0.2rem;
  padding: 0.25rem;
  border-radius: var(--mrbs-radius);
  background: var(--mrbs-blue-soft);
}

nav.view a,
nav.arrow a {
  border: 0;
  border-radius: var(--mrbs-radius-sm) !important;
  background: transparent;
  color: var(--mrbs-blue-deep);
  font-weight: 600;
  transition: background-color var(--mrbs-fast) ease, color var(--mrbs-fast) ease,
              box-shadow var(--mrbs-fast) ease, transform var(--mrbs-fast) var(--mrbs-ease);
}

nav.view a {
  padding: 0.35rem 0.8rem;
}

nav.arrow a {
  padding: 0.3rem 0.9rem;
}

nav.view a:hover,
nav.view a:focus,
nav.arrow a:hover,
nav.arrow a:focus {
  border: 0;
  background: rgba(0, 80, 115, 0.12);
  color: var(--mrbs-blue-deep);
  box-shadow: none;
  text-decoration: none;
}

nav a.selected,
nav.view a.selected:hover,
nav.arrow a:active {
  border: 0;
  background: var(--mrbs-blue);
  box-shadow: 0 4px 10px rgba(0, 80, 115, 0.28);
  color: #ffffff;
  text-decoration: none;
}

nav.arrow a:active {
  transform: scale(0.96);
}

nav.location select,
nav.location .select2-container {
  min-width: 9rem;
}

/* ------------------------------------------------------------------ */
/* 6. Calendar / data tables                                           */
/* ------------------------------------------------------------------ */
.table_container {
  overflow: auto;
  border: 1px solid var(--mrbs-line);
  border-radius: var(--mrbs-radius-lg);
  background: var(--mrbs-surface);
  box-shadow: var(--mrbs-shadow);
}

.dwm_main thead th,
.dwm_main tfoot th {
  background-color: var(--mrbs-blue-soft);
  color: var(--mrbs-blue-deep);
  font-weight: 650;
}

.dwm_main thead tr:last-child th {
  border-bottom: 2px solid var(--mrbs-yellow);
}

.dwm_main th[data-room] a,
.dwm_main th a {
  color: var(--mrbs-blue-deep);
  font-weight: 650;
}

.dwm_main th[data-room] a:hover,
.dwm_main th a:hover {
  color: var(--mrbs-blue);
}

.dwm_main tbody th {
  color: var(--mrbs-blue-deep);
  font-weight: 600;
}

/* Free slots: soft highlight on hover so it is obvious they are clickable */
.dwm_main td.new {
  transition: background-color var(--mrbs-fast) ease, box-shadow var(--mrbs-fast) ease;
}

.dwm_main td.new:hover {
  background-color: rgba(0, 80, 115, 0.07);
  box-shadow: inset 0 0 0 2px rgba(0, 80, 115, 0.25);
}

/* Booked slots: gentle lift on hover */
.dwm_main td.booked,
.dwm_main .booked a {
  transition: filter var(--mrbs-fast) ease, box-shadow var(--mrbs-fast) ease,
              transform var(--mrbs-fast) var(--mrbs-ease);
}

.dwm_main td.booked:hover {
  filter: brightness(0.96) saturate(1.05);
  box-shadow: inset 0 0 0 1px rgba(0, 59, 89, 0.28);
}

.capacity {
  color: var(--mrbs-muted);
  font-size: 0.8em;
}

/* Admin / report / list tables */
table.admin_table,
table.display,
table.list {
  border-color: var(--mrbs-line);
  border-radius: var(--mrbs-radius);
}

.admin_table th {
  letter-spacing: 0.02em;
}

.admin_table tbody tr,
table.display tbody tr {
  transition: background-color var(--mrbs-fast) ease;
}

.admin_table tbody tr:hover,
table.display tbody tr:hover {
  background-color: var(--mrbs-blue-tint) !important;
}

.admin_table td.action a,
.admin_table td.action input {
  transition: transform var(--mrbs-fast) var(--mrbs-ease), opacity var(--mrbs-fast) ease;
}

.admin_table td.action a:hover {
  transform: scale(1.12);
}

/* DataTables controls */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  margin-left: 0.4rem;
  margin-right: 0.4rem;
}

/* "Show N entries": leave room for the number, the arrow must not cover it */
.dataTables_wrapper .dataTables_length select {
  width: auto;
  min-width: 4.75rem;
  padding: 0.4rem 2.2rem 0.4rem 0.8rem;
  text-overflow: clip;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--mrbs-radius-sm) !important;
  transition: background-color var(--mrbs-fast) ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  border-color: var(--mrbs-blue) !important;
  background: var(--mrbs-blue) !important;
  color: #ffffff !important;
}

/* ------------------------------------------------------------------ */
/* 7. Inputs                                                           */
/* ------------------------------------------------------------------ */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input.form-control,
select,
textarea {
  box-sizing: border-box;
  max-width: 100%;
  border: 1px solid var(--mrbs-line-strong);
  border-radius: var(--mrbs-radius);
  background-color: var(--mrbs-surface);
  color: var(--mrbs-ink);
  font: inherit;
  line-height: 1.4;
  padding: 0.55rem 0.8rem;
  transition: border-color var(--mrbs-fast) ease, box-shadow var(--mrbs-fast) ease,
              background-color var(--mrbs-fast) ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):hover,
select:hover,
textarea:hover {
  border-color: var(--mrbs-muted);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
input.form-control:focus,
select:focus,
textarea:focus {
  border-color: var(--mrbs-blue);
  background-color: #ffffff;
  box-shadow: var(--mrbs-ring);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #93a5b3;
  opacity: 1;
}

input:disabled,
select:disabled,
textarea:disabled,
input[readonly] {
  background-color: var(--mrbs-blue-tint);
  color: var(--mrbs-muted);
  cursor: not-allowed;
}

textarea {
  min-height: 6rem;
  resize: vertical;
  line-height: 1.5;
}

/* Custom select arrow */
select:not([multiple]) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.2rem;
  background-image: var(--mrbs-select-arrow);
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.7rem;
  cursor: pointer;
}

select[multiple] {
  padding: 0.35rem;
}

select[multiple] option {
  border-radius: 0.35rem;
  padding: 0.25rem 0.5rem;
}

/* Checkboxes + radios use the brand colour */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--mrbs-blue);
  width: 1.05rem;
  height: 1.05rem;
  cursor: pointer;
}

input[type="checkbox"] + label,
input[type="radio"] + label,
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* 8. Buttons                                                          */
/* ------------------------------------------------------------------ */
input[type="submit"],
input[type="button"],
input[type="reset"],
input.button,
a.button,
button:not(.image):not(.flatpickr-day):not(.select2-selection__choice__remove):not(.password-toggle) {
  display: inline-block;
  border: 1px solid var(--mrbs-blue);
  border-radius: var(--mrbs-radius);
  background: var(--mrbs-blue);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 80, 115, 0.2);
  transition: background-color var(--mrbs-fast) ease, border-color var(--mrbs-fast) ease,
              box-shadow var(--mrbs-fast) ease, transform var(--mrbs-fast) var(--mrbs-ease);
}

input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input.button:hover,
a.button:hover,
button:not(.image):not(.flatpickr-day):not(.select2-selection__choice__remove):not(.password-toggle):hover {
  border-color: var(--mrbs-blue-deep);
  background: var(--mrbs-blue-deep);
  box-shadow: 0 6px 16px rgba(0, 59, 89, 0.28);
  transform: translateY(-1px);
}

input[type="submit"]:active,
input[type="button"]:active,
input[type="reset"]:active,
input.button:active,
button:not(.image):not(.password-toggle):active {
  box-shadow: 0 1px 3px rgba(0, 59, 89, 0.3);
  transform: translateY(0) scale(0.985);
}

input[type="submit"]:focus-visible,
input[type="button"]:focus-visible,
input[type="reset"]:focus-visible,
input.button:focus-visible,
button:not(.image):not(.password-toggle):focus-visible,
a:focus-visible {
  outline: 3px solid rgba(255, 213, 0, 0.8);
  outline-offset: 2px;
}

input[type="submit"]:disabled,
input[type="button"]:disabled,
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Secondary styling for "Back / Cancel / Reset"-type buttons */
input[type="button"][name="back_button"],
input[type="submit"][name="back_button"],
input[type="button"].cancel,
input[type="reset"],
input[name="cancel_button"],
input.button.secondary {
  border-color: var(--mrbs-line-strong);
  background: var(--mrbs-surface);
  color: var(--mrbs-blue-deep);
  box-shadow: none;
}

input[type="button"][name="back_button"]:hover,
input[type="submit"][name="back_button"]:hover,
input[type="button"].cancel:hover,
input[type="reset"]:hover,
input[name="cancel_button"]:hover,
input.button.secondary:hover {
  border-color: var(--mrbs-blue);
  background: var(--mrbs-blue-soft);
  color: var(--mrbs-blue-deep);
  box-shadow: none;
}

/* Delete buttons get a clear-but-restrained danger treatment */
input.delete,
input[name="delete_button"],
input[type="submit"][value*="Delete"],
input[type="submit"][value*="Hapus"] {
  border-color: #b3261e;
  background: #b3261e;
}

input.delete:hover,
input[name="delete_button"]:hover,
input[type="submit"][value*="Delete"]:hover,
input[type="submit"][value*="Hapus"]:hover {
  border-color: #8c1d18;
  background: #8c1d18;
}

/* ------------------------------------------------------------------ */
/* 9. Forms — modern grid layout (replaces the old table-cell layout)  */
/* ------------------------------------------------------------------ */
.standard {
  float: none;
  clear: both;
  width: 100%;
  max-width: 60rem;
  box-sizing: border-box;
  margin: 1.25rem 0 2rem;
}

.standard > fieldset,
.standard fieldset {
  display: block;
  float: none;
  clear: both;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 1.25rem;
  padding: 1.1rem 1.5rem 1.3rem;
  border: 1px solid var(--mrbs-line);
  border-radius: var(--mrbs-radius-lg);
  background: var(--mrbs-surface);
  box-shadow: var(--mrbs-shadow-sm);
}

.standard fieldset > legend,
fieldset > legend {
  padding: 0 0.6rem;
  color: var(--mrbs-blue-deep);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* One row = label | control(s) */
.standard fieldset > div {
  display: grid;
  grid-template-columns: minmax(8rem, 12.5rem) minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem 1.25rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(215, 227, 234, 0.7);
}

.standard fieldset > div:last-child {
  border-bottom: 0;
}

.standard fieldset > div > *:not(.none) {
  display: revert;
  min-width: 0;
  vertical-align: baseline;
}

.standard fieldset > div > label {
  display: block;
  padding: 0;
  color: var(--mrbs-blue-deep);
  font-weight: 600;
  text-align: left;
}

/* Rows that start with a non-label (buttons, notes) span the full width */
.standard fieldset > div > *:first-child:not(label) {
  grid-column: 1 / -1;
}

/* Rows with multi-line controls: align label to top */
.standard fieldset > div.multiline,
.standard fieldset > div.field_text_area {
  align-items: start;
}

.standard fieldset .multiline label,
.standard fieldset .field_text_area label {
  padding-top: 0.55rem;
}

/* The control wrapper: flex so inputs, selects, checkboxes sit nicely */
.standard fieldset > div > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  text-align: left;
}

.standard fieldset > div > div > *,
.standard div.group {
  float: none;
  margin-top: 0;
}

.standard div.group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
}

.standard div.group.long {
  flex-direction: column;
  align-items: flex-start;
}

.standard div.group.long label {
  float: none;
  margin-bottom: 0.2rem;
}

.standard .group label {
  margin-right: 0;
}

.standard input,
.standard input.enabler,
.standard select {
  margin-right: 0;
}

/* Control sizes */
.standard input[type="text"]:not(.date):not(.form-control),
.standard input[type="email"],
.standard input[type="password"],
.standard input[type="search"],
.standard input[type="url"],
.standard textarea {
  width: min(100%, 28rem);
}

.standard input[type="text"].short {
  width: 5rem;
}

.standard input[type="number"] {
  width: 5.5rem;
}

.standard input[type="number"][step="0.01"] {
  width: 7rem;
}

.standard textarea {
  height: 7rem;
}

.standard input[type="radio"],
.standard input[type="checkbox"] {
  margin: 0 0.35rem 0 0;
  vertical-align: middle;
}

.standard ul {
  clear: both;
}

/* Nested fieldsets (repeat options, booking controls, etc.) */
.standard fieldset fieldset {
  margin: 0.5rem 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--mrbs-line);
  border-left: 4px solid var(--mrbs-yellow);
  border-radius: var(--mrbs-radius);
  background: var(--mrbs-blue-tint);
  box-shadow: none;
  animation: mrbs-fade-in var(--mrbs-med) ease-out backwards;
}

.standard fieldset fieldset legend {
  font-size: 0.92rem;
  font-style: normal;
  font-weight: 650;
}

.standard fieldset fieldset > div {
  border-bottom-color: rgba(195, 211, 221, 0.6);
}

/* Fieldsets and rows that are toggled by JS fade rather than snap */
.standard fieldset[hidden],
.standard div[hidden] {
  display: none;
}

/* Submit / action buttons row: the row is a div.submit_buttons holding the
   Back button (inside its label) and the Save button + live check marks. */
.standard fieldset:has(> div.submit_buttons) {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.standard div.submit_buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 0;
}

.standard div.submit_buttons > label {
  display: flex;
  padding: 0;
}

.standard div.submit_buttons > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
}

.standard div.submit_buttons input.default_action {
  min-width: 8rem;
  padding: 0.65rem 1.6rem;
  border-color: var(--mrbs-yellow);
  background: var(--mrbs-yellow);
  color: var(--mrbs-blue-deep);
  box-shadow: 0 4px 12px rgba(255, 213, 0, 0.45);
}

.standard div.submit_buttons input.default_action:hover {
  border-color: #ffe34d;
  background: #ffe34d;
  color: var(--mrbs-blue-deep);
  box-shadow: 0 8px 20px rgba(255, 213, 0, 0.55);
}

.buttons input,
.edit_entry_handler #submit_buttons form input {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* Narrow screens: stack the labels above the inputs */
@media (max-width: 40rem) {
  .standard fieldset {
    padding: 1rem 1.1rem 1.1rem;
  }

  .standard fieldset > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }

  .standard fieldset > div > label {
    padding-top: 0;
  }

  .standard input[type="text"]:not(.date):not(.form-control),
  .standard input[type="email"],
  .standard input[type="password"],
  .standard input[type="search"],
  .standard input[type="url"],
  .standard textarea {
    width: 100%;
  }

  .standard div.submit_buttons > label,
  .standard div.submit_buttons > div,
  .standard div.submit_buttons input {
    flex: 1 1 100%;
  }
}

/* ------------------------------------------------------------------ */
/* 10. Login card                                                      */
/* ------------------------------------------------------------------ */
#logon.standard {
  width: min(100% - 2rem, 30rem);
  max-width: 30rem;
  margin: clamp(2rem, 9vh, 5.5rem) auto;
  padding: 2rem 2rem 1.6rem;
  border: 1px solid var(--mrbs-line);
  border-top: 5px solid var(--mrbs-yellow);
  border-radius: var(--mrbs-radius-lg);
  background: var(--mrbs-surface);
  box-shadow: var(--mrbs-shadow-lg);
  animation: mrbs-pop-in 520ms var(--mrbs-ease) backwards;
}

#logon.standard fieldset {
  width: 100%;
  margin: 0;
  padding: 0.4rem 0 0.9rem;
  border: 0;
  box-shadow: none;
  background: transparent;
}

#logon.standard legend {
  padding: 0 0 0.6rem;
  font-size: 1.5rem;
  font-weight: 750;
  color: var(--mrbs-blue-deep);
}

#logon.standard fieldset > div {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.3rem;
  padding: 0.5rem 0;
  border-bottom: 0;
}

#logon.standard input[type="text"],
#logon.standard input[type="password"] {
  width: 100%;
  padding: 0.7rem 0.9rem;
}

#logon.standard input[type="submit"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

#logon.standard p {
  color: var(--mrbs-muted);
}

/* ------------------------------------------------------------------ */
/* 11. Booking detail view, pending list, messages                     */
/* ------------------------------------------------------------------ */
.view_entry .contents > table,
.view_entry table#entry {
  border-collapse: separate;
  border-spacing: 0;
  width: min(100%, 60rem);
  overflow: hidden;
  border: 1px solid var(--mrbs-line);
  border-radius: var(--mrbs-radius-lg);
  background: var(--mrbs-surface);
  box-shadow: var(--mrbs-shadow-sm);
}

.view_entry table#entry td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(215, 227, 234, 0.7);
}

.view_entry table#entry tr:last-child td {
  border-bottom: 0;
}

.view_entry table#entry td:first-child {
  color: var(--mrbs-blue-deep);
  font-weight: 650;
  background: var(--mrbs-blue-tint);
  white-space: nowrap;
}

.view_entry table#entry tr {
  transition: background-color var(--mrbs-fast) ease;
}

.view_entry table#entry tr:hover td:last-child {
  background: var(--mrbs-blue-tint);
}

#pending_list,
#pending_list table {
  border-radius: var(--mrbs-radius);
}

.error,
p.error,
div.error {
  padding: 0.7rem 1rem;
  border: 1px solid rgba(179, 38, 30, 0.3);
  border-left: 4px solid #b3261e;
  border-radius: var(--mrbs-radius-sm);
  background: #fdf2f1;
  color: #8c1d18;
  animation: mrbs-shake 420ms ease-in-out;
}

.message_top,
.message {
  padding: 0.7rem 1rem;
  border-left: 4px solid var(--mrbs-yellow);
  border-radius: var(--mrbs-radius-sm);
  background: var(--mrbs-blue-soft);
}

/* ------------------------------------------------------------------ */
/* 12. Third-party widgets (jQuery UI, Select2, Flatpickr)             */
/* ------------------------------------------------------------------ */
.ui-widget-overlay {
  background: rgba(0, 59, 89, 0.45);
  opacity: 1;
  backdrop-filter: blur(3px);
  animation: mrbs-fade-in var(--mrbs-med) ease-out;
}

.ui-dialog {
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: var(--mrbs-radius-lg);
  box-shadow: var(--mrbs-shadow-lg);
  animation: mrbs-pop-in var(--mrbs-med) var(--mrbs-ease) backwards;
}

.ui-dialog .ui-dialog-titlebar {
  border: 0;
  border-radius: 0;
  background: linear-gradient(115deg, var(--mrbs-blue-deep), var(--mrbs-blue));
  color: #ffffff;
  padding: 0.8rem 1.1rem;
}

.ui-dialog .ui-dialog-content {
  padding: 1.1rem;
}

.ui-dialog .ui-dialog-buttonpane {
  margin: 0;
  padding: 0.7rem 1rem;
  border: 0;
  border-top: 1px solid var(--mrbs-line);
  background: var(--mrbs-blue-tint);
}

.ui-tabs {
  border-radius: var(--mrbs-radius);
}

.ui-tabs .ui-tabs-panel {
  animation: mrbs-fade-in var(--mrbs-med) ease-out;
}

.ui-widget-header,
.ui-tabs .ui-tabs-nav {
  border-color: var(--mrbs-line);
  background: var(--mrbs-blue-soft);
}

.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-tabs .ui-tabs-nav li.ui-state-active {
  border-color: var(--mrbs-blue);
  background: var(--mrbs-blue);
  color: #ffffff;
}

.ui-state-active a,
.ui-state-active a:link,
.ui-state-active a:visited {
  color: #ffffff;
}

/* Select2 */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  min-height: 2.45rem;
  border: 1px solid var(--mrbs-line-strong);
  border-radius: var(--mrbs-radius);
  transition: border-color var(--mrbs-fast) ease, box-shadow var(--mrbs-fast) ease;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--mrbs-ink);
  line-height: 2.35rem;
  padding-left: 0.8rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 2.35rem;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default .select2-selection--multiple:focus-within {
  border-color: var(--mrbs-blue);
  box-shadow: var(--mrbs-ring);
}

.select2-dropdown {
  overflow: hidden;
  border: 1px solid var(--mrbs-line);
  border-radius: var(--mrbs-radius);
  box-shadow: var(--mrbs-shadow);
  animation: mrbs-drop-in var(--mrbs-fast) ease-out;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--mrbs-blue);
  color: #ffffff;
}

.select2-container--default .select2-results__option[aria-selected="true"],
.select2-container--default .select2-results__option--selected {
  background-color: var(--mrbs-blue-soft);
}

/* Flatpickr */
.flatpickr-calendar {
  border-radius: var(--mrbs-radius-lg);
  box-shadow: var(--mrbs-shadow-lg);
  font-family: inherit;
}

.flatpickr-calendar.open {
  animation: mrbs-pop-in var(--mrbs-med) var(--mrbs-ease);
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months {
  color: var(--mrbs-blue-deep);
  fill: var(--mrbs-blue-deep);
}

.flatpickr-day {
  transition: background-color var(--mrbs-fast) ease, color var(--mrbs-fast) ease;
}

.flatpickr-day.today:not(.selected) {
  border-color: var(--mrbs-yellow);
  background: rgba(255, 213, 0, 0.25);
}

/* ------------------------------------------------------------------ */
/* 13. Animations                                                      */
/* ------------------------------------------------------------------ */
@keyframes mrbs-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes mrbs-soft-in {
  from { opacity: 0.35; }
  to   { opacity: 1; }
}

@keyframes mrbs-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes mrbs-drop-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes mrbs-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes mrbs-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 213, 0, 0.55); }
  50%      { box-shadow: 0 0 0 7px rgba(255, 213, 0, 0); }
}

@keyframes mrbs-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}


/* ------------------------------------------------------------------ */
/* 15. Bubble animations (event details, previews, approval)           */
/* ------------------------------------------------------------------ */
@keyframes mrbs-bubble-in {
  0%   { opacity: 0; transform: scale(0.55) translateY(14px); }
  55%  { opacity: 1; transform: scale(1.04) translateY(-2px); }
  80%  { transform: scale(0.98) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes mrbs-bubble-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* Event detail page */
#entry,
.rejection_card,
.conflict_bubble {
  transform-origin: 18% 0;
  animation: mrbs-bubble-in 560ms var(--mrbs-ease) backwards;
}

#entry ~ #view_entry_nav,
h3 + h4 {
  animation: mrbs-fade-up var(--mrbs-slow) var(--mrbs-ease) 120ms backwards;
}

#entry tbody tr {
  animation: mrbs-bubble-in 480ms var(--mrbs-ease) backwards;
}

#entry tbody tr:nth-child(1) { animation-delay: 60ms; }
#entry tbody tr:nth-child(2) { animation-delay: 110ms; }
#entry tbody tr:nth-child(3) { animation-delay: 160ms; }
#entry tbody tr:nth-child(4) { animation-delay: 210ms; }
#entry tbody tr:nth-child(5) { animation-delay: 260ms; }
#entry tbody tr:nth-child(n+6) { animation-delay: 310ms; }

#view_entry_nav input[type="submit"],
#view_entry_nav button,
#approve_buttons input[type="submit"],
.reason_chip {
  transition: transform var(--mrbs-fast) var(--mrbs-ease), box-shadow var(--mrbs-fast) ease;
}

#view_entry_nav input[type="submit"]:hover,
#approve_buttons input[type="submit"]:hover,
.reason_chip:hover {
  transform: translateY(-2px) scale(1.04);
}

#view_entry_nav input[type="submit"]:active,
#approve_buttons input[type="submit"]:active,
.reason_chip:active {
  transform: scale(0.94);
}

/* Rejection reason form */
#approve_buttons textarea {
  animation: mrbs-bubble-in 420ms var(--mrbs-ease) backwards;
  transform-origin: 10% 0;
}

.reason_chips {
  line-height: 2.4;
}

.reason_chip {
  margin: 0 0.25rem 0.25rem 0;
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--mrbs-line-strong);
  border-radius: 999px;
  background: var(--mrbs-blue-soft);
  color: var(--mrbs-blue-deep);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.reason_chip:nth-of-type(1) { animation: mrbs-bubble-in 420ms var(--mrbs-ease) 60ms backwards; }
.reason_chip:nth-of-type(2) { animation: mrbs-bubble-in 420ms var(--mrbs-ease) 120ms backwards; }
.reason_chip:nth-of-type(3) { animation: mrbs-bubble-in 420ms var(--mrbs-ease) 180ms backwards; }
.reason_chip:nth-of-type(4) { animation: mrbs-bubble-in 420ms var(--mrbs-ease) 240ms backwards; }

/* Conflicts */
.conflict_bubble {
  padding: 0.8rem 1rem;
  border: 1px solid #f0c36d;
  border-left-width: 5px;
  border-radius: var(--mrbs-radius);
  background: #fff8e6;
  box-shadow: var(--mrbs-shadow-sm);
}

.conflict_bubble ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}

.conflict_warning {
  margin: 0.4rem 0;
  color: #9b1c1c;
  font-weight: 600;
}

.conflict_tag,
.clash_badge {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.is_approved .conflict_tag,
.clash_badge.is_approved {
  background: #fde2e2;
  color: #9b1c1c;
}

.is_pending .conflict_tag,
.clash_badge.is_pending {
  background: #ffefc2;
  color: #7a5200;
}

.clash_badge {
  animation: mrbs-bubble-in 520ms var(--mrbs-ease) backwards, mrbs-bubble-float 2.8s ease-in-out 600ms infinite;
}

/* Rejected requests list */
.rejection_list {
  display: grid;
  gap: 0.8rem;
  max-width: 46rem;
}

.rejection_card {
  padding: 0.8rem 1rem;
  border: 1px solid var(--mrbs-line);
  border-left: 5px solid #c0392b;
  border-radius: var(--mrbs-radius);
  background: var(--mrbs-surface);
  box-shadow: var(--mrbs-shadow-sm);
}

.rejection_card.is_new {
  box-shadow: 0 0 0 3px rgba(255, 213, 0, 0.55), var(--mrbs-shadow-sm);
}

.rejection_card:nth-child(2) { animation-delay: 70ms; }
.rejection_card:nth-child(3) { animation-delay: 140ms; }
.rejection_card:nth-child(n+4) { animation-delay: 210ms; }

.rejection_meta {
  color: var(--mrbs-muted);
  font-size: 0.85rem;
}

.rejection_reason {
  margin: 0.45rem 0;
  padding: 0.5rem 0.7rem;
  border-radius: var(--mrbs-radius-sm);
  background: #fdf2f2;
}

.rejection_reason span {
  font-weight: 600;
}

/* Hover preview bubble on calendar bookings (built by theme.js) */
.booking-bubble {
  position: absolute;
  z-index: 1000;
  max-width: 18rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--mrbs-radius);
  background: var(--mrbs-blue-deep);
  color: #fff;
  box-shadow: var(--mrbs-shadow-lg);
  font-size: 0.85rem;
  line-height: 1.4;
  pointer-events: none;
  transform-origin: 50% 100%;
  animation: mrbs-bubble-in 360ms var(--mrbs-ease) backwards;
}

.booking-bubble.below {
  transform-origin: 50% 0;
}

.booking-bubble::after {
  content: "";
  position: absolute;
  left: var(--tail-x, 50%);
  bottom: -6px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: inherit;
  transform: rotate(45deg);
}

.booking-bubble.below::after {
  top: -6px;
  bottom: auto;
}

.booking-bubble .bb-title {
  display: block;
  font-weight: 700;
}

.booking-bubble .bb-status {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--mrbs-yellow);
  color: var(--mrbs-blue-deep);
  font-size: 0.72rem;
  font-weight: 700;
}

.booking-bubble.leaving {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 120ms ease, transform 120ms ease;
}

.notification .badge {
  animation: mrbs-bubble-in 600ms var(--mrbs-ease) backwards;
}

/* ------------------------------------------------------------------ */
/* 14. Responsive + accessibility                                      */
/* ------------------------------------------------------------------ */
@media (max-width: 48rem) {
  .contents,
  .banner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  nav.main_calendar {
    justify-content: center;
  }

  nav.main_calendar > nav {
    flex-basis: 100%;
  }

  nav.main_calendar > nav:first-child,
  nav.main_calendar > nav:last-child {
    justify-content: center;
  }

  nav.location {
    gap: 0.35rem;
  }
}

@media print {
  .banner,
  nav.main_calendar {
    box-shadow: none;
    animation: none;
  }

  .contents > * {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* 15. Visible input boxes (bbox) — easy to spot, same palette         */
/* ------------------------------------------------------------------ */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input.form-control,
select,
textarea,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  border: 2px solid rgba(0, 80, 115, 0.38);
  border-radius: var(--mrbs-radius);
  background-color: var(--mrbs-blue-tint);
  box-shadow: inset 0 2px 4px rgba(0, 55, 82, 0.07), 0 1px 0 #ffffff;
}

/* Hover: the box strengthens to the full brand blue */
input[type="text"]:hover,
input[type="password"]:hover,
input[type="email"]:hover,
input[type="url"]:hover,
input[type="tel"]:hover,
input[type="search"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
input[type="time"]:hover,
input[type="datetime-local"]:hover,
input.form-control:hover,
select:hover,
textarea:hover,
.select2-container--default .select2-selection--single:hover,
.select2-container--default .select2-selection--multiple:hover {
  border-color: var(--mrbs-blue);
  background-color: #ffffff;
}

/* Focus: blue box + yellow halo, impossible to miss */
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
input.form-control:focus,
select:focus,
textarea:focus,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default .select2-selection--multiple:focus-within {
  border-color: var(--mrbs-blue);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 213, 0, 0.55), 0 6px 16px rgba(0, 80, 115, 0.16);
  outline: none;
}

/* Invalid values get a clear box too (only after the user has typed) */
input:not(:placeholder-shown):invalid,
textarea:not(:placeholder-shown):invalid {
  border-color: #b3261e;
}

/* Disabled / read-only: dashed box so they read as "not editable" */
input:disabled,
select:disabled,
textarea:disabled,
input[readonly] {
  border: 2px dashed var(--mrbs-line-strong);
  background-color: var(--mrbs-bg);
  box-shadow: none;
}

/* Checkboxes and radios: real visible boxes */
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  width: 1.3rem;
  height: 1.3rem;
  margin: 0;
  border: 2px solid var(--mrbs-blue);
  background-color: #ffffff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 80%;
  box-shadow: inset 0 1px 2px rgba(0, 55, 82, 0.1);
  transition: background-color var(--mrbs-fast) ease, box-shadow var(--mrbs-fast) ease,
              transform var(--mrbs-fast) var(--mrbs-ease);
}

input[type="checkbox"] {
  border-radius: 0.4rem;
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="checkbox"]:hover,
input[type="radio"]:hover {
  box-shadow: 0 0 0 4px rgba(0, 80, 115, 0.14);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 213, 0, 0.7);
}

input[type="checkbox"]:checked {
  background-color: var(--mrbs-blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23ffd500' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

input[type="radio"]:checked {
  background-color: #ffffff;
  background-image: radial-gradient(circle, var(--mrbs-blue) 0 38%, transparent 42%);
  border-color: var(--mrbs-blue);
}

input[type="checkbox"]:active,
input[type="radio"]:active {
  transform: scale(0.9);
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
  border-style: dashed;
  opacity: 0.6;
}

/* ------------------------------------------------------------------ */
/* 16. Compact header + tighter page spacing                           */
/* ------------------------------------------------------------------ */

/* --- Header: one tidy row ------------------------------------------ */
.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem 1.25rem;
  min-height: 3.5rem;
  padding: 0 1.5rem;
}

.banner .logo {
  flex: 0 0 auto;
}

.banner .logo img {
  margin: 0.4rem 0;
  max-height: 2.6rem;
  width: auto;
}

/* Company block: small company name over a bold system title, left aligned */
.banner .company {
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: center;
  gap: 0.1rem;
  margin: 0;
  padding: 0.5rem 1.25rem 0.5rem 0;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  line-height: 1.15;
  font-size: 1rem;
}

.banner .company > a:first-child,
.banner .company > span:first-child,
.banner .company_more_info {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.banner .company > a:last-child {
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.005em;
}

/* Right-hand area: search on the left of it, menu + user on the right */
.banner nav.container {
  flex: 1 1 28rem;
  width: auto;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 1rem;
  padding: 0;
}

.banner nav.container > nav {
  align-items: center;
  padding: 0;
}

/* The search / go-to-date nav comes first (left), menu + logon last (right) */
.banner nav.container > nav:last-child {
  order: -1;
  margin-right: auto;
}

.banner nav.container > nav:first-child {
  flex-wrap: nowrap;
  gap: 0.5rem;
}

.banner nav.menu {
  flex-wrap: wrap;
  gap: 0.15rem;
}

.banner nav.menu a {
  margin: 0;
  padding: 0.42rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
}

/* User + log off sit in a separated group */
.banner nav.logon {
  gap: 0.5rem;
  margin-left: 0.5rem;
  padding-left: 0.9rem;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  flex-wrap: nowrap;
}

.banner nav.logon a,
.banner nav.logon input,
.banner nav.logon span {
  margin: 0;
  font-size: 0.9rem;
}

.banner form#show_my_entries input.link[type="submit"] {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.banner form#show_my_entries input.link[type="submit"]:hover {
  background: rgba(255, 255, 255, 0.26);
  text-decoration: none;
}

.banner nav.logon input[type="submit"]:not(.link),
.banner nav.logon input[type="button"] {
  padding: 0.33rem 0.9rem;
  font-weight: 600;
}

/* Search pill with magnifier icon (hover/focus must keep readable text) */
.banner input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
  width: 13rem;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.8rem center;
  background-size: 0.95rem;
  color: #ffffff;
  font-size: 0.9rem;
  padding: 0.38rem 0.9rem 0.38rem 2.3rem;
}

.banner input[type="search"]:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background-color: rgba(255, 255, 255, 0.2);
}

.banner input[type="search"]:focus {
  width: 16rem;
  border-color: var(--mrbs-yellow);
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23005073' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  color: var(--mrbs-ink);
  box-shadow: 0 0 0 3px rgba(255, 213, 0, 0.4);
}

.banner #form_nav {
  margin: 0;
  padding: 0;
}

.banner #form_nav input[type="date"],
.banner #form_nav input.form-control {
  border-width: 1px;
  box-shadow: none;
  color: #ffffff;
  font-size: 0.9rem;
  padding: 0.38rem 0.8rem;
}

.banner #form_nav input[type="date"]:hover,
.banner #form_nav input.form-control:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background-color: rgba(255, 255, 255, 0.2);
}

.banner #form_nav input:focus {
  color: var(--mrbs-ink);
}

/* --- Page spacing ---------------------------------------------------- */
.contents {
  padding: 0 1.5rem 1.25rem;
}

h1 {
  margin: 0.9rem 0 0.7rem;
  padding-bottom: 0.4rem;
}

h2 {
  margin: 1rem 0 0.45rem;
}

h2.date {
  margin: 0.5rem 0 0.35rem;
}

h3 {
  margin: 0.8rem 0 0.35rem;
}

.contents > h2:first-child,
.contents > h1:first-child {
  margin-top: 0.9rem;
}

.contents p {
  margin: 0.35rem 0 0.7rem;
}

.admin h2:not(:first-child) {
  margin-top: 1.1rem;
}

.admin .message_top {
  padding-left: 0;
}

div#area_form,
div#room_form {
  padding: 0 0 0.6rem;
}

div#div_custom_html {
  padding: 0 0 1rem 0.5rem;
}

.contents form.js_hidden,
.contents > form {
  margin-bottom: 0.5rem;
}

nav.main_calendar {
  margin-top: 0.5rem;
  padding: 0.5rem 0.7rem;
}

.minicalendars {
  padding-top: 0.5rem;
}

/* Forms: compact, and only as wide as their content (except big forms) */
.standard {
  width: fit-content;
  min-width: min(100%, 24rem);
  max-width: min(100%, 60rem);
  margin: 0.4rem 0 1rem;
}

.edit_entry .standard,
.edit_room .standard,
.edit_area .standard,
.report .standard,
.import .standard,
.edit_users .standard {
  width: 100%;
}

.standard fieldset {
  margin: 0 0 0.75rem;
  padding: 0.8rem 1.25rem 0.9rem;
}

.standard fieldset > div {
  padding: 0.4rem 0;
  gap: 0.3rem 1rem;
}

.standard fieldset fieldset {
  margin: 0.35rem 0;
  padding: 0.7rem 1rem;
}

.standard fieldset > legend,
fieldset > legend {
  padding: 0 0.5rem;
  font-size: 1.05rem;
}

.standard ul {
  margin: 0.4rem 0;
}

.buttons input,
.edit_entry_handler #submit_buttons form input {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Tables: less air around them */
.table_container {
  margin-top: 0.5rem;
}

#logon.standard {
  margin: clamp(1.5rem, 6vh, 3.5rem) auto;
}

@media (max-width: 48rem) {
  .banner {
    padding: 0.4rem 1rem;
  }

  .banner .company {
    padding-right: 0;
    border-right: 0;
  }

  .banner nav.container {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .banner nav.container > nav:last-child {
    margin-right: 0;
  }

  .banner nav.logon {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .contents {
    padding: 0 1rem 1rem;
  }
}

/* ------------------------------------------------------------------ */
/* 17. App layout: sidebar + top bar + content                         */
/* ------------------------------------------------------------------ */
:root {
  --mrbs-sidebar-w: 16.5rem;
  --mrbs-sidebar-w-collapsed: 5.2rem;
  --mrbs-topbar-h: 4.1rem;
}

body {
  margin: 0;
}

.app-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.app-main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.app-main > .contents {
  float: none;
  flex: 1 1 auto;
  width: auto;
  box-sizing: border-box;
  padding: 1.25rem 1.75rem 2.25rem;
}

/* The simple (error / upgrade) header keeps the classic blue banner */
.app-main > .banner.simple {
  width: 100%;
  box-sizing: border-box;
}

/* --- Sidebar --------------------------------------------------------- */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex: 0 0 var(--mrbs-sidebar-w);
  flex-direction: column;
  align-self: flex-start;
  gap: 1.1rem;
  width: var(--mrbs-sidebar-w);
  height: 100vh;
  box-sizing: border-box;
  padding: 1.1rem 0.85rem 1rem;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(255, 255, 255, 0.1), transparent 14rem),
    linear-gradient(185deg, var(--mrbs-blue-deep), var(--mrbs-blue));
  color: #ffffff;
  box-shadow: 6px 0 28px rgba(0, 55, 82, 0.18);
  transition: width var(--mrbs-med) var(--mrbs-ease), flex-basis var(--mrbs-med) var(--mrbs-ease),
              transform var(--mrbs-med) var(--mrbs-ease);
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.9rem;
  padding: 0 0.35rem;
  border-radius: var(--mrbs-radius);
  color: #ffffff;
  text-decoration: none;
}

.sidebar .brand:hover {
  background: none;
  color: #ffffff;
}

.sidebar .brand_mark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 0.85rem;
  background: var(--mrbs-yellow);
  color: var(--mrbs-blue-deep);
  box-shadow: 0 6px 16px rgba(255, 213, 0, 0.35);
  transition: transform var(--mrbs-med) var(--mrbs-ease);
}

.sidebar .brand:hover .brand_mark {
  transform: rotate(-6deg) scale(1.05);
}

.sidebar .brand_mark.has_logo {
  padding: 0.3rem;
  background: #ffffff;
}

.sidebar .brand_mark img {
  max-width: 100%;
  max-height: 100%;
}

.sidebar .brand_text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.sidebar .brand_text small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar .brand_text strong {
  font-size: 0.98rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.sidebar .side_menu {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 0;
  overflow-y: auto;
  padding: 0.2rem 0;
  scrollbar-width: none;
}

.sidebar .side_menu::-webkit-scrollbar {
  display: none;
}

.sidebar .side_menu a,
.sidebar .side_menu a:link,
.sidebar .side_menu a:visited {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.72rem 0.9rem;
  border-radius: var(--mrbs-radius);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  font-weight: 560;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color var(--mrbs-fast) ease, color var(--mrbs-fast) ease,
              transform var(--mrbs-fast) var(--mrbs-ease);
}

.sidebar .side_menu a .icon {
  flex: 0 0 auto;
  transition: transform var(--mrbs-med) var(--mrbs-ease);
}

.sidebar .side_menu a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateX(3px);
}

.sidebar .side_menu a:hover .icon {
  transform: scale(1.12);
}

.sidebar .side_menu a.active,
.sidebar .side_menu a.active:link,
.sidebar .side_menu a.active:visited {
  background: #ffffff;
  color: var(--mrbs-blue-deep);
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 30, 50, 0.28);
  transform: none;
}

.sidebar .side_menu a.active .icon {
  color: var(--mrbs-blue);
}

.sidebar .side_menu a.active::before {
  content: "";
  position: absolute;
  top: 22%;
  bottom: 22%;
  left: -0.85rem;
  width: 5px;
  border-radius: 0 5px 5px 0;
  background: var(--mrbs-yellow);
}

/* User card + log on/off */
.sidebar .side_user {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.sidebar .side_who {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--mrbs-radius);
  background: rgba(255, 255, 255, 0.09);
}

.sidebar .avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: var(--mrbs-yellow);
  color: var(--mrbs-blue-deep);
  font-weight: 800;
}

.sidebar .who_name {
  min-width: 0;
}

.sidebar .who_name form,
.sidebar .side_user form {
  margin: 0;
  padding: 0;
}

.sidebar .who_name input.link[type="submit"],
.sidebar .who_name span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 650;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.sidebar .who_name input.link[type="submit"]:hover {
  background: none;
  color: var(--mrbs-yellow);
  transform: none;
}

.sidebar .side_user form > input[type="submit"] {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.7rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--mrbs-radius);
  background-color: rgba(255, 255, 255, 0.08);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.95rem center;
  background-size: 1.1rem;
  box-shadow: none;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
}

.sidebar .side_user > form:first-child > input[type="submit"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4M10 17l5-5-5-5M15 12H3'/%3E%3C/svg%3E");
}

.sidebar .side_user form > input[type="submit"]:hover {
  border-color: var(--mrbs-yellow);
  background-color: var(--mrbs-yellow);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23003b59' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E");
  color: var(--mrbs-blue-deep);
  box-shadow: 0 8px 20px rgba(255, 213, 0, 0.35);
}

.sidebar .side_user > form:first-child > input[type="submit"]:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23003b59' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4M10 17l5-5-5-5M15 12H3'/%3E%3C/svg%3E");
}

.sidebar_overlay {
  display: none;
}

/* Collapsed (icons only) on wide screens */
@media (min-width: 64.01rem) {
  html.sidebar-collapsed .sidebar {
    flex-basis: var(--mrbs-sidebar-w-collapsed);
    width: var(--mrbs-sidebar-w-collapsed);
    padding-right: 0.7rem;
    padding-left: 0.7rem;
  }

  html.sidebar-collapsed .sidebar .brand {
    justify-content: center;
    padding: 0;
  }

  html.sidebar-collapsed .sidebar .brand_text,
  html.sidebar-collapsed .sidebar .side_menu a .label,
  html.sidebar-collapsed .sidebar .who_name {
    display: none;
  }

  html.sidebar-collapsed .sidebar .side_menu a {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  html.sidebar-collapsed .sidebar .side_menu a.active::before {
    left: -0.7rem;
  }

  html.sidebar-collapsed .sidebar .side_who {
    justify-content: center;
    padding: 0.45rem 0;
    background: none;
  }

  html.sidebar-collapsed .sidebar .side_user form > input[type="submit"] {
    width: 100%;
    height: 2.7rem;
    padding: 0;
    background-position: center;
    font-size: 0;
  }
}

/* --- Top bar --------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  min-height: var(--mrbs-topbar-h);
  box-sizing: border-box;
  padding: 0.6rem 1.75rem;
  border-bottom: 1px solid var(--mrbs-line);
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 24px rgba(0, 55, 82, 0.05);
}

.topbar .menu_toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--mrbs-line-strong);
  border-radius: var(--mrbs-radius);
  background: #ffffff;
  color: var(--mrbs-blue);
  cursor: pointer;
  transition: background-color var(--mrbs-fast) ease, border-color var(--mrbs-fast) ease,
              transform var(--mrbs-fast) var(--mrbs-ease);
}

.topbar .menu_toggle:hover {
  border-color: var(--mrbs-blue);
  background: var(--mrbs-blue-soft);
}

.topbar .menu_toggle:active {
  transform: scale(0.94);
}

.topbar .page_heading {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.topbar .eyebrow {
  overflow: hidden;
  color: var(--mrbs-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar .page_title {
  color: var(--mrbs-blue-deep);
  font-size: 1.6rem;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.topbar .top_actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.topbar .top_actions > div,
.topbar .top_actions form {
  margin: 0;
  padding: 0;
}

.topbar #form_nav:not(.js_hidden) {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.topbar #form_nav input[type="date"],
.topbar #form_nav input.form-control {
  width: 9.6rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.topbar #form_nav input[type="submit"] {
  padding: 0.48rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
}

.topbar input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
  width: 14rem;
  padding: 0.45rem 0.95rem 0.45rem 2.4rem;
  border-radius: 999px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23005073' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.85rem center;
  background-size: 1rem;
  font-size: 0.9rem;
  transition: width var(--mrbs-med) var(--mrbs-ease), border-color var(--mrbs-fast) ease,
              box-shadow var(--mrbs-fast) ease, background-color var(--mrbs-fast) ease;
}

.topbar input[type="search"]:focus {
  width: 18rem;
}

/* Notification bell */
.topbar a.notification {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--mrbs-line-strong);
  border-radius: 50%;
  background: #ffffff;
  color: var(--mrbs-blue);
  transition: background-color var(--mrbs-fast) ease, border-color var(--mrbs-fast) ease,
              transform var(--mrbs-fast) var(--mrbs-ease);
}

.topbar a.notification:hover {
  border-color: var(--mrbs-blue);
  background: var(--mrbs-blue-soft);
  color: var(--mrbs-blue-deep);
  transform: translateY(-1px);
}

.topbar a.notification.attention {
  border-color: var(--mrbs-yellow);
  animation: mrbs-pulse 2.4s ease-in-out infinite;
}

.topbar a.notification .badge {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  min-width: 1.15rem;
  box-sizing: border-box;
  padding: 0.05rem 0.3rem;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--mrbs-yellow);
  color: var(--mrbs-blue-deep);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.topbar nav.qr {
  width: 3rem;
  height: 3rem;
}

/* --- Content polish -------------------------------------------------- */
.contents > h2:not(.date),
.admin h2:not(.date) {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.contents > h2:not(.date)::before,
.admin h2:not(.date)::before {
  content: "";
  flex: 0 0 auto;
  width: 0.32rem;
  height: 1.15em;
  border-radius: 3px;
  background: var(--mrbs-yellow);
}

/* --- Special pages --------------------------------------------------- */
/* Login page: no sidebar, centred card */
.app-shell:has(#logon.standard) .sidebar,
.app-shell:has(#logon.standard) .topbar .menu_toggle,
.app-shell:has(#logon.standard) .topbar .top_actions {
  display: none;
}

/* Kiosk display */
[data-kiosk] .sidebar,
[data-kiosk] .topbar .menu_toggle,
[data-kiosk] .topbar .top_actions {
  display: none;
}

/* --- Narrow screens: off-canvas sidebar ------------------------------ */
@media (max-width: 64rem) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1200;
    width: min(17.5rem, 86vw);
    transform: translateX(-105%);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 14px 0 50px rgba(0, 30, 50, 0.4);
  }

  .sidebar_overlay {
    position: fixed;
    inset: 0;
    z-index: 1190;
    display: block;
    background: rgba(0, 59, 89, 0.5);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--mrbs-med) ease, visibility var(--mrbs-med) ease;
  }

  body.sidebar-open .sidebar_overlay {
    opacity: 1;
    visibility: visible;
  }

  .topbar {
    padding: 0.55rem 1rem;
  }

  .app-main > .contents {
    padding: 1rem 1rem 2rem;
  }
}

@media (max-width: 40rem) {
  .topbar .eyebrow,
  .topbar #form_nav {
    display: none !important;
  }

  .topbar .page_title {
    font-size: 1.15rem;
  }

  .topbar input[type="search"] {
    width: 9.5rem;
  }

  .topbar input[type="search"]:focus {
    width: 11.5rem;
  }
}

@media print {
  .app-shell {
    display: block;
  }

  .sidebar,
  .sidebar_overlay,
  .topbar {
    display: none !important;
  }

  .app-main > .contents {
    padding: 0;
  }
}

/* ------------------------------------------------------------------ */
/* 18. Fixes found while testing the new layout                        */
/* ------------------------------------------------------------------ */

/* The calendar page is limited to the viewport height by the base CSS
   (body.index { max-height: 100vh }).  Make the app shell follow the same
   rule, so that the table scrolls inside its own container. */
@media screen and (min-height: 50.01rem) and (min-width: 30.01rem) {
  body.index .app-shell,
  body.index .app-main {
    height: 100vh;
    min-height: 0;
  }

  body.index .app-main > .contents {
    min-height: 0;
  }
}

/* Single buttons in a form row stay their natural width */
.standard fieldset > div > input[type="submit"],
.standard fieldset > div > input[type="button"],
.standard fieldset > div > button {
  justify-self: start;
}

/* Checkbox / radio labels: box and text sit on one line with a gap */
.standard label:has(> input[type="checkbox"]),
.standard label:has(> input[type="radio"]) {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-right: 0.6rem;
  font-weight: 500;
}

/* ------------------------------------------------------------------ */
/* 19. Mini calendars (left) — flatpickr inline                        */
/* ------------------------------------------------------------------ */
.minicalendars {
  padding-top: 0;
}

.minicalendars.formed {
  flex: 0 0 auto;
  margin-right: 1.25rem;
}

.minicalendars .flatpickr-calendar.inline {
  --mc-cell: 2.25rem;
  position: relative;
  top: 0;
  display: block;
  box-sizing: border-box;
  width: calc(7 * var(--mc-cell) + 1.7rem);
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem 0.9rem;
  overflow: hidden;
  border: 1px solid var(--mrbs-line);
  border-top: 4px solid var(--mrbs-yellow);
  border-radius: var(--mrbs-radius-lg);
  background: var(--mrbs-surface);
  box-shadow: var(--mrbs-shadow);
  font-size: 1rem;
  transition: box-shadow var(--mrbs-med) ease, transform var(--mrbs-med) var(--mrbs-ease);
}

.minicalendars .flatpickr-calendar.inline:hover {
  box-shadow: var(--mrbs-shadow-lg);
  transform: translateY(-2px);
}

/* Header: ‹  [Month ▾] [Year]  › on one tidy row */
.minicalendars .flatpickr-calendar.inline .flatpickr-months {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-months .flatpickr-month {
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
  overflow: visible;
  line-height: 1;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-current-month {
  position: static;
  left: auto;
  display: flex;
  flex: 1 1 0%;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-current-month .flatpickr-monthDropdown-months {
  position: relative;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.3rem 1.55rem 0.3rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background-color: transparent;
  box-shadow: none;
  color: var(--mrbs-blue-deep);
  font-size: 0.98rem;
  font-weight: 750;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-current-month .flatpickr-monthDropdown-months:hover {
  background-color: var(--mrbs-blue-soft);
}

.minicalendars .flatpickr-calendar.inline .flatpickr-current-month .numInputWrapper {
  width: 4.2rem;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-current-month input.cur-year {
  height: auto;
  padding: 0.3rem 0.2rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  box-shadow: none;
  color: var(--mrbs-muted);
  font-size: 0.98rem;
  font-weight: 650;
  text-align: center;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-current-month input.cur-year:hover,
.minicalendars .flatpickr-calendar.inline .flatpickr-current-month input.cur-year:focus {
  background: var(--mrbs-blue-soft);
  box-shadow: none;
  color: var(--mrbs-blue-deep);
}

.minicalendars .flatpickr-calendar.inline .flatpickr-months .flatpickr-prev-month,
.minicalendars .flatpickr-calendar.inline .flatpickr-months .flatpickr-next-month {
  position: static;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 50%;
  background: var(--mrbs-blue-soft);
  transition: background-color var(--mrbs-fast) ease, transform var(--mrbs-fast) var(--mrbs-ease);
}

.minicalendars .flatpickr-calendar.inline .flatpickr-months .flatpickr-prev-month svg,
.minicalendars .flatpickr-calendar.inline .flatpickr-months .flatpickr-next-month svg {
  width: 0.7rem;
  height: 0.7rem;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-months .flatpickr-prev-month svg path,
.minicalendars .flatpickr-calendar.inline .flatpickr-months .flatpickr-next-month svg path {
  fill: var(--mrbs-blue);
  transition: fill var(--mrbs-fast) ease;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-months .flatpickr-prev-month:hover,
.minicalendars .flatpickr-calendar.inline .flatpickr-months .flatpickr-next-month:hover {
  background: var(--mrbs-blue);
  transform: scale(1.08);
}

.minicalendars .flatpickr-calendar.inline .flatpickr-months .flatpickr-prev-month:hover svg path,
.minicalendars .flatpickr-calendar.inline .flatpickr-months .flatpickr-next-month:hover svg path {
  fill: #ffffff;
}

/* Weekday names + day grid, with proper room to breathe */
.minicalendars .flatpickr-calendar.inline .flatpickr-innerContainer,
.minicalendars .flatpickr-calendar.inline .flatpickr-rContainer {
  display: block;
  width: 100%;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-weekdays {
  width: calc(7 * var(--mc-cell));
  height: auto;
  margin-bottom: 0.2rem;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-weekdaycontainer {
  display: flex;
  width: 100%;
}

.minicalendars .flatpickr-calendar.inline span.flatpickr-weekday {
  flex: 1 1 0;
  height: auto;
  background: transparent;
  color: var(--mrbs-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.8;
  text-transform: uppercase;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-days,
.minicalendars .flatpickr-calendar.inline .dayContainer {
  width: calc(7 * var(--mc-cell));
  min-width: calc(7 * var(--mc-cell));
  max-width: calc(7 * var(--mc-cell));
  padding: 0;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-day {
  flex: 0 0 var(--mc-cell);
  width: var(--mc-cell);
  max-width: var(--mc-cell);
  height: var(--mc-cell);
  margin: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--mrbs-ink);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: calc(var(--mc-cell) - 2px);
  transition: background-color var(--mrbs-fast) ease, color var(--mrbs-fast) ease,
              transform var(--mrbs-fast) var(--mrbs-ease), box-shadow var(--mrbs-fast) ease;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-day:hover,
.minicalendars .flatpickr-calendar.inline .flatpickr-day:focus {
  border-color: transparent;
  background: var(--mrbs-blue-soft);
  color: var(--mrbs-blue-deep);
  transform: scale(1.1);
}

.minicalendars .flatpickr-calendar.inline .flatpickr-day.prevMonthDay,
.minicalendars .flatpickr-calendar.inline .flatpickr-day.nextMonthDay {
  color: #a7b7c3;
  font-weight: 500;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-day.today:not(.selected) {
  border-color: var(--mrbs-yellow);
  background: rgba(255, 213, 0, 0.28);
  color: var(--mrbs-blue-deep);
}

.minicalendars .flatpickr-calendar.inline .flatpickr-day.selected,
.minicalendars .flatpickr-calendar.inline .flatpickr-day.selected:hover {
  border-color: var(--mrbs-blue);
  background: var(--mrbs-blue);
  box-shadow: 0 6px 14px rgba(0, 80, 115, 0.35);
  color: #ffffff;
  transform: none;
}

/* ------------------------------------------------------------------ */
/* 20. Booking schedule panel (day / week / month tables)              */
/* ------------------------------------------------------------------ */
.view_container {
  gap: 0.75rem;
}

nav.main_calendar {
  margin: 0;
  flex: 0 0 auto;
}

h2.date {
  flex: 0 0 auto;
}

.view_container > .table_container {
  margin-top: 0;
  min-height: 0;
  border-radius: var(--mrbs-radius-lg);
}

table.dwm_main {
  border-radius: var(--mrbs-radius-lg);
}

/* Header row: room names with a neat capacity pill */
.dwm_main thead th {
  padding: 0.7rem 0.5rem;
  background: var(--mrbs-blue-soft);
  color: var(--mrbs-blue-deep);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
}

.dwm_main thead th a {
  color: var(--mrbs-blue-deep);
}

.dwm_main .capacity {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 80, 115, 0.1);
  color: var(--mrbs-blue);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: 0.08em;
}

.dwm_main .capacity::before,
.dwm_main .capacity::after {
  content: none;
}

/* Time column: always wide enough, never clipped */
.dwm_main thead th.first_last,
.dwm_main tfoot th.first_last,
.dwm_main tbody th {
  box-sizing: border-box;
  width: 5.6rem;
  min-width: 5.6rem;
  white-space: nowrap;
}

.dwm_main tbody th {
  padding: 0 0.85rem 0 0.6rem;
  background: var(--mrbs-blue-tint);
  color: var(--mrbs-muted);
  font-size: 0.8rem;
  font-weight: 650;
  text-align: right;
  vertical-align: top;
}

.dwm_main tbody th a {
  color: var(--mrbs-muted);
}

/* Free slots: show a "+" so it is obvious that you can book here */
.dwm_main td.new a::after {
  content: "+";
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--mrbs-blue);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
  transition: opacity var(--mrbs-fast) ease, transform var(--mrbs-med) var(--mrbs-ease);
  pointer-events: none;
}

.dwm_main td.new:hover a::after {
  opacity: 0.9;
  transform: translate(-50%, -50%) scale(1);
}

/* Booked slots: rounded "event cards" with an accent edge */
.dwm_main .booked:not(.multiply) a {
  top: 2px;
  left: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  padding: 0.25rem 0.6rem;
  border-bottom: 0;
  border-radius: 0.6rem;
  box-shadow: inset 4px 0 0 rgba(0, 59, 89, 0.55), 0 2px 6px rgba(0, 55, 82, 0.12);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
}

.dwm_main .booked:not(.multiply) a:hover {
  box-shadow: inset 4px 0 0 var(--mrbs-blue-deep), 0 8px 18px rgba(0, 55, 82, 0.22);
  text-decoration: none;
}

.dwm_main .booked.multiply .booking {
  border-radius: 0.45rem;
}

/* "Now" marker */
div.timeline {
  background-color: var(--mrbs-blue-deep);
  box-shadow: 0 0 0 1px rgba(255, 213, 0, 0.7);
}

div.timeline::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--mrbs-blue-deep);
  border-radius: 50%;
  background: var(--mrbs-yellow);
  transform: translateY(-50%);
}

div.timeline.times_along_top::before {
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
}

/* ------------------------------------------------------------------ */
/* 21. Booking-type legend (colour key)                                */
/* ------------------------------------------------------------------ */
.color_key {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: auto;
  margin: 0.25rem 0 0.5rem;
}

.color_key > div {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: auto;
  margin: 0;
  padding: 0.35rem 0.95rem 0.35rem 0.8rem;
  border: 1px solid rgba(0, 59, 89, 0.18);
  border-radius: 999px;
  box-shadow: var(--mrbs-shadow-sm);
  font-size: 0.82rem;
  font-weight: 650;
  text-align: left;
  transition: transform var(--mrbs-fast) var(--mrbs-ease), box-shadow var(--mrbs-fast) ease;
}

.color_key > div::before {
  content: "";
  flex: 0 0 auto;
  width: 0.65rem;
  height: 0.65rem;
  border: 2px solid var(--mrbs-blue-deep);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

.color_key > div:hover {
  box-shadow: var(--mrbs-shadow);
  transform: translateY(-1px);
}

/* Keep the calendar cards inside the view area (no horizontal overflow) */
.view_container > nav.main_calendar,
.view_container > .table_container {
  box-sizing: border-box;
  max-width: 100%;
}


/* ------------------------------------------------------------------ */
/* 22. Fixes: slot selection, week/month header                        */
/* ------------------------------------------------------------------ */

/* While dragging out a booking, don't show the hover "+" / highlight on each cell passed */
.dwm_main.resizing td.new:hover {
  box-shadow: none;
}

.dwm_main.resizing td.new a::after {
  display: none;
}

/* The selection rectangle itself */
div.div_select {
  border-radius: 0.5rem;
  background-color: var(--mrbs-blue);
  opacity: 0.28;
  box-shadow: inset 0 0 0 2px var(--mrbs-blue-deep);
}

/* Selected time labels while dragging */
.dwm_main.resizing tbody tr th.selected {
  background-color: var(--mrbs-blue);
}

.dwm_main.resizing tbody tr th.selection-end {
  background-color: var(--mrbs-blue-soft);
  box-shadow: inset 0 2px 0 var(--mrbs-blue);
  color: var(--mrbs-blue-deep);
}

/* Week / multi-day views have TWO header rows (weekday, then date):
   keep them close together so they read as one block. */
.dwm_main thead tr:first-child:not(:only-child) th {
  padding-top: 0.65rem;
  padding-bottom: 0.05rem;
  line-height: 1.2;
}

.dwm_main thead tr:last-child:not(:only-child) th {
  padding-top: 0.05rem;
  padding-bottom: 0.65rem;
  line-height: 1.2;
}

.dwm_main thead tr:first-child:not(:only-child) th a {
  color: var(--mrbs-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dwm_main thead tr:last-child:not(:only-child) th a {
  font-size: 1.02rem;
  font-weight: 750;
}

.dwm_main thead tr:not(:only-child) th a {
  display: block;
  height: auto;
}

.dwm_main thead tr:first-child:not(:only-child) th {
  border-bottom: 0;
}


/* ------------------------------------------------------------------ */
/* 23. Mini calendar centring + booking selection badge                */
/* ------------------------------------------------------------------ */

/* flatpickr writes the calendar / days width straight into style="" (measured at start-up),
   which beat the rules above and left the day grid off-centre.  !important wins over it. */
.minicalendars .flatpickr-calendar.inline {
  width: calc(7 * var(--mc-cell) + 1.7rem + 2px) !important;
  min-width: calc(7 * var(--mc-cell) + 1.7rem + 2px) !important;
  max-width: calc(7 * var(--mc-cell) + 1.7rem + 2px) !important;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-days,
.minicalendars .flatpickr-calendar.inline .flatpickr-weekdays,
.minicalendars .flatpickr-calendar.inline .dayContainer {
  width: calc(7 * var(--mc-cell)) !important;
  min-width: calc(7 * var(--mc-cell)) !important;
  max-width: calc(7 * var(--mc-cell)) !important;
  margin-right: auto;
  margin-left: auto;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-innerContainer {
  justify-content: center;
}

/* Selection box: translucent fill so that the time badge stays fully opaque */
div.div_select {
  box-sizing: border-box;
  opacity: 1;
  background-color: rgba(0, 80, 115, 0.26);
  border-bottom: 3px solid var(--mrbs-blue-deep);
  box-shadow: inset 0 0 0 2px var(--mrbs-blue);
}

div.div_select.outside {
  background-color: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
}

div.div_select[data-range]::after {
  content: attr(data-range);
  position: absolute;
  top: 0.25rem;
  left: 0.4rem;
  padding: 0.12rem 0.65rem;
  border-radius: 999px;
  background: var(--mrbs-blue-deep);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 55, 82, 0.35);
}

div.div_select.outside[data-range]::after {
  display: none;
}

/* ------------------------------------------------------------------ */
/* 99. Polish pass                                                     */
/* ------------------------------------------------------------------ */

/* Mini calendars: the year was cut off ("202") */
.minicalendars .flatpickr-calendar.inline .flatpickr-current-month .flatpickr-monthDropdown-months {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.3rem 1.15rem 0.3rem 0.3rem;
  font-size: 0.9rem;
  background-position: right 0.35rem center;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-current-month .numInputWrapper {
  flex: 0 0 3.5rem;
  width: 3.5rem;
}

.minicalendars .flatpickr-calendar.inline .flatpickr-current-month input.cur-year {
  width: 100%;
  padding: 0.3rem 0.5rem 0.3rem 0.2rem;
}

/* "Go to" date field: solid pill instead of a dashed box */
.topbar #form_nav input[type="date"],
.topbar #form_nav input.form-control {
  border: 1px solid var(--mrbs-line-strong);
  border-style: solid;
  background: var(--mrbs-surface);
  color: var(--mrbs-ink);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.topbar #form_nav input.form-control:hover {
  border-color: var(--mrbs-blue);
  background: var(--mrbs-blue-tint);
}

/* Booking cards: one clear colour per booking type, readable text */
:where(.dwm_main) a {
  --bk-bg: #dcebf3;
  --bk-edge: #005073;
  --bk-ink: #00364f;
}

.dwm_main .booked:not(.multiply) a,
.dwm_main .booked.multiply .booking a {
  background-color: var(--bk-bg);
  color: var(--bk-ink);
  box-shadow: inset 5px 0 0 var(--bk-edge), 0 2px 6px rgba(0, 55, 82, 0.12);
}

.dwm_main a[data-type="A"] { --bk-bg: #fde4dc; --bk-edge: #d9482b; --bk-ink: #6b2412; }
.dwm_main a[data-type="B"] { --bk-bg: #fff1bf; --bk-edge: #d9a400; --bk-ink: #5c4500; }
.dwm_main a[data-type="C"] { --bk-bg: #d8f1ec; --bk-edge: #0f9b8a; --bk-ink: #0b4a43; }
.dwm_main a[data-type="D"] { --bk-bg: #e7e1fa; --bk-edge: #6a4fd1; --bk-ink: #35276e; }
.dwm_main a[data-type="E"] { --bk-bg: #dcebf3; --bk-edge: #005073; --bk-ink: #00364f; }
.dwm_main a[data-type="F"] { --bk-bg: #dff3d9; --bk-edge: #3f9a2c; --bk-ink: #21501a; }
.dwm_main a[data-type="G"] { --bk-bg: #fbe0ee; --bk-edge: #c23b83; --bk-ink: #661c43; }
.dwm_main a[data-type="H"] { --bk-bg: #e6ebef; --bk-edge: #5b7083; --bk-ink: #2a3a47; }
.dwm_main a[data-type="I"] { --bk-bg: #ffe6cf; --bk-edge: #e0771a; --bk-ink: #663408; }
.dwm_main a[data-type="J"] { --bk-bg: #dbe9ff; --bk-edge: #2f6fde; --bk-ink: #17356b; }

/* Tipe booking yang dipakai (config.inc.php); selaras dengan $color_types di styling.inc */
.dwm_main a[data-type="R"] { --bk-bg: #dcebff; --bk-edge: #2f6fde; --bk-ink: #17356b; } /* Rapat   - biru */
.dwm_main a[data-type="V"] { --bk-bg: #ffe9c9; --bk-edge: #e0771a; --bk-ink: #663408; } /* Event   - oranye */
.dwm_main a[data-type="S"] { --bk-bg: #fbdce4; --bk-edge: #d9486f; --bk-ink: #66182f; } /* Sidang  - merah muda */
.dwm_main a[data-type="K"] { --bk-bg: #dff3d4; --bk-edge: #3f9a2c; --bk-ink: #21501a; } /* Kelas   - hijau */
.dwm_main a[data-type="L"] { --bk-bg: #ece1f8; --bk-edge: #8a52c8; --bk-ink: #3f2468; } /* Lainnya - ungu */

.dwm_main .booked:not(.multiply) a:hover,
.dwm_main .booked.multiply .booking a:hover {
  box-shadow: inset 5px 0 0 var(--bk-edge), 0 10px 22px rgba(0, 55, 82, 0.24);
  filter: saturate(1.08) brightness(0.985);
}

/* The type colour of the wrapper must not show as a rim around the card */
.dwm_main .booked:not(.multiply) div.booking {
  background: transparent;
}

/* Hour lines are a little stronger than half-hour lines */
.dwm_main tbody tr:nth-child(odd) th,
.dwm_main tbody tr:nth-child(odd) td {
  border-top-color: var(--mrbs-line-strong);
}

/* Free slots: soft highlight so the row you will book is obvious */
.dwm_main td.new:hover {
  background-color: rgba(0, 80, 115, 0.08);
}

/* Show/hide-password eye (all forms): input wrapped in .password-field by general.js.php */
.standard .password-field {
  width: min(100%, 28rem);
}

#logon.standard .password-field,
#change_password .password-field {
  width: 100%;
}

.password-field > input[type="password"],
.password-field > input[type="text"] {
  width: 100%;
  padding-right: 3.2rem;
}

.password-field > button.password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 calc(var(--mrbs-radius-sm) - 1px) calc(var(--mrbs-radius-sm) - 1px) 0;
  background: transparent;
  box-shadow: none;
  color: var(--mrbs-muted);
  opacity: 1;
  line-height: 1;
  transition: color var(--mrbs-fast) ease, background-color var(--mrbs-fast) ease;
}

.password-field > button.password-toggle:hover {
  color: var(--mrbs-blue);
  background: var(--mrbs-blue-soft);
  transform: none;
  box-shadow: none;
}

.password-field > button.password-toggle:active {
  color: var(--mrbs-blue-deep);
  transform: none;
}

.password-field > button.password-toggle:focus-visible {
  outline: 3px solid var(--mrbs-yellow);
  outline-offset: -3px;
  color: var(--mrbs-blue);
}

.password-field > button.password-toggle .eye-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.password-field > button.password-toggle svg {
  display: block;
  width: 1.3rem;
  height: 1.3rem;
}

#logon.standard .password-field > input[type="password"],
#logon.standard .password-field > input[type="text"] {
  padding-right: 3.4rem;
}

@media (max-width: 48rem) {
  .standard .password-field {
    width: 100%;
  }
}

/* Keyboard focus is always visible */
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--mrbs-yellow);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ------------------------------------------------------------------ */
/* 99. Identitas SPs UGM: logo putih, judul panjang, ubah password      */
/* ------------------------------------------------------------------ */

/* Gunakan Gama Serif untuk teks identitas/logo, dengan fallback serif. */
.sidebar .brand_text,
.banner .company {
  font-family: "Gama Serif", Georgia, "Times New Roman", serif;
}

/* Lambang UGM berwarna putih: tampil langsung di atas sidebar biru */
.sidebar .brand_mark.has_logo {
  width: 3.4rem;
  height: 3.5rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar .brand_mark.has_logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar .brand:hover .brand_mark.has_logo {
  transform: scale(1.05);
}

.sidebar .brand {
  align-items: center;
  min-height: 3.6rem;
}

/* Nama instansi panjang: boleh turun beberapa baris */
.sidebar .brand_text small {
  overflow: visible;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
}

.sidebar .brand_text strong {
  margin-top: 0.15rem;
}

/* Tautan "Ubah Password" di bawah nama pengguna */
.sidebar .side_user a.side_link,
.sidebar .side_user a.side_link:link,
.sidebar .side_user a.side_link:visited {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.55rem 0;
  padding: 0.55rem 0.9rem;
  border-radius: var(--mrbs-radius);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.88rem;
  font-weight: 560;
  text-decoration: none;
  transition: background-color var(--mrbs-fast) ease, color var(--mrbs-fast) ease;
}

.sidebar .side_user a.side_link:hover,
.sidebar .side_user a.side_link.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.sidebar .side_user a.side_link .icon {
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
}

@media (min-width: 64.01rem) {
  html.sidebar-collapsed .sidebar .side_user a.side_link {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
  }

  html.sidebar-collapsed .sidebar .side_user a.side_link .label {
    display: none;
  }
}

/* Pesan sukses pada form */
form.standard p.success {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid #9ad5b0;
  border-radius: var(--mrbs-radius);
  background: #e8f7ee;
  color: #14683a;
  font-weight: 600;
}

#change_password {
  max-width: 34rem;
}


/* ---- Booking details: title, time, place, short description ---- */
.dwm_main .booking a .bk-title {
  font-weight: 700;
}

.dwm_main .booking a .bk-meta {
  font-size: 0.82em;
  font-weight: 600;
  opacity: 0.85;
}

.dwm_main .booking a .bk-time {
  white-space: nowrap;
}

.dwm_main .booking a .bk-desc {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.8em;
  font-weight: 400;
  line-height: 1.3;
  opacity: 0.8;
  overflow-wrap: anywhere;
}

/* Day/week (single room) cells: let the text wrap but never spill out of the card */
.dwm_main .booked .booking a {
  overflow: hidden;
  line-height: 1.3;
}

/* Week view of all rooms: the day's bookings listed under the overview bars */
.dwm_main .day_bookings {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.3rem 0.2rem 0.2rem;
}

/* The overview bars become a thin timeline strip above the list */
.dwm_main.all_rooms td a.day_bar {
  height: 0.5rem;
  min-height: 0;
  line-height: 0;
  margin: 0.3rem 0.2rem 0;
  border-radius: 999px;
  overflow: hidden;
}

.dwm_main.all_rooms td a.day_bar div {
  padding: 0;
  font-size: 0;
}

.dwm_main.all_rooms td a.day_bar div::before {
  content: none;
}

/* Seven equal day columns that fit the page */
.dwm_main.all_rooms#week_main {
  table-layout: fixed;
  width: 100%;
}

.dwm_main.all_rooms#week_main thead th:first-child,
.dwm_main.all_rooms#week_main tfoot th:first-child {
  width: 8.5rem;
}

.dwm_main .day_bookings .booking {
  position: static;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  border-radius: 0.4rem;
}

.dwm_main .day_bookings .booking a {
  display: block;
  position: static;
  height: auto;
  padding: 0.25rem 0.1rem 0.25rem 0.45rem;
  border-radius: 0.4rem;
  background-color: var(--bk-bg);
  color: var(--bk-ink);
  box-shadow: inset 4px 0 0 var(--bk-edge);
  font-size: 0.72rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dwm_main .day_bookings .booking a .bk-meta {
  display: block;
}

.dwm_main .day_bookings .booking a .bk-time {
  white-space: normal;
}

.dwm_main .day_bookings .booking a,
.dwm_main .day_bookings .booking a .bk-desc {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

/* Month view of a single room: each entry shows title, time and a short description */
#month_main .booking_list div {
  float: none;
  height: auto;
  max-height: none;
  min-height: 1.3em;
  margin-bottom: 0.2rem;
  line-height: 1.25;
  overflow: hidden;
}

#month_main .booking_list div a {
  display: block;
  height: auto;
  padding: 0.15rem 0.3rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

#month_main .booking_list div a .bk-title {
  display: block;
}

#month_main .booking_list div a .bk-meta {
  display: block;
}

#month_main .booking_list div a .bk-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* The hover bubble shows the details on separate lines */
.booking-bubble .bb-desc {
  display: block;
  margin-top: 0.25rem;
  white-space: pre-line;
}

/* ------------------------------------------------------------------ */
/* 23. Mobile-friendly calendar                                        */
/* ------------------------------------------------------------------ */
@media (max-width: 48rem) {
  /* Tabel kalender bisa digeser ke samping, kolom pertama tetap terlihat */
  .view_container > .table_container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  /* Minggu semua ruangan: 7 hari dengan lebar tetap yang nyaman dibaca */
  .dwm_main.all_rooms#week_main {
    table-layout: fixed;
    width: 100%;
    min-width: 46rem;
  }

  .dwm_main.all_rooms#week_main thead th:first-child,
  .dwm_main.all_rooms#week_main tfoot th:first-child {
    width: 6.5rem;
  }

  .dwm_main.all_rooms#week_main tbody th:first-child,
  .dwm_main.all_rooms#week_main thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    box-shadow: 2px 0 0 rgba(0, 59, 89, 0.08);
  }

  /* Hari / minggu satu ruangan & bulan */
  #day_main,
  #week_main:not(.all_rooms) {
    min-width: 34rem;
  }

  #month_main {
    min-width: 36rem;
  }

  .dwm_main thead th {
    padding: 0.5rem 0.3rem;
    font-size: 0.78rem;
  }

  .dwm_main tbody th {
    font-size: 0.72rem;
    padding: 0 0.4rem;
  }

  .dwm_main tbody th a,
  .dwm_main tbody th {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .dwm_main .day_bookings .booking a {
    font-size: 0.7rem;
    padding: 0.25rem 0.3rem 0.25rem 0.5rem;
  }

  /* Navigasi tanggal: tombol lebih besar untuk jari */
  nav.main_calendar {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  nav.main_calendar > nav {
    flex: 1 1 100%;
    justify-content: center;
  }

  nav.arrow a,
  nav.main_calendar a,
  nav.main_calendar button,
  nav.main_calendar select,
  nav.main_calendar input {
    min-height: 2.5rem;
  }

  /* Legenda warna: chip lebih kecil, boleh turun baris */
  .color_key {
    gap: 0.35rem;
  }

  .color_key > div {
    padding: 0.25rem 0.7rem 0.25rem 0.55rem;
    font-size: 0.74rem;
  }

  /* Form: cegah zoom otomatis di iOS & lebarkan kolom */
  input,
  select,
  textarea {
    font-size: 16px;
    max-width: 100%;
  }

  .standard fieldset,
  form.standard {
    max-width: 100%;
    box-sizing: border-box;
  }

  .standard .form_general > div,
  .standard fieldset > div {
    flex-wrap: wrap;
  }

  .standard label {
    width: 100%;
  }

  /* Tabel data (laporan, pending, pencarian) bisa digeser */
  .app-main > .contents table.display,
  .app-main > .contents table.admin_table,
  .app-main > .contents #pending_list {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 30rem) {
  .app-main > .contents {
    padding: 0.75rem 0.6rem 1.5rem;
  }

  .dwm_main .booked:not(.multiply) a {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
  }

  .booking-bubble {
    max-width: 90vw;
  }
}


/* ------------------------------------------------------------------ */
/* Ghost mode: saat drag di kalender (booking ganda diizinkan),         */
/* booking yang sudah ada menjadi transparan                            */
/* ------------------------------------------------------------------ */

.dwm_main.allow-double td.booked {
  transition: opacity 0.15s ease;
}

.dwm_main.allow-double.resizing td.booked:not(.ui-resizable-resizing) {
  opacity: 0.3;
}

.dwm_main.allow-double.resizing td.booked:not(.ui-resizable-resizing):hover {
  box-shadow: none;
}


/* ------------------------------------------------------------------ */
/* 18. Input polish: tinggi seragam, penanda wajib, error yang benar,   */
/*     nyaman di HP                                                     */
/* ------------------------------------------------------------------ */

/* Tinggi seragam supaya input, select, dan tanggal sejajar dalam satu baris */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input.form-control,
select:not([multiple]) {
  min-height: 2.75rem;
}

/* Placeholder lebih terbaca (kontras sebelumnya terlalu rendah) */
input::placeholder,
textarea::placeholder {
  color: #6f8494;
}

/* Label formulir lebih tegas */
.standard fieldset > div > label {
  color: var(--mrbs-ink);
  font-weight: 600;
}

/* Penanda kolom wajib diisi: tanda * merah di belakang label */
.standard label:has(+ input:required)::after,
.standard label:has(+ select:required)::after,
.standard label:has(+ textarea:required)::after {
  content: " *";
  color: #b3261e;
  font-weight: 700;
}

/* Perbaikan error: kolom wajib yang masih kosong tidak langsung merah saat halaman dibuka.
   Merah baru muncul setelah pengguna mengisi/meninggalkan kolom (:user-invalid). */
input:not(:placeholder-shown):invalid:not(:user-invalid):not(:hover):not(:focus),
textarea:not(:placeholder-shown):invalid:not(:user-invalid):not(:hover):not(:focus),
select:invalid:not(:user-invalid):not(:hover):not(:focus) {
  border-color: rgba(0, 80, 115, 0.38);
}

input:user-invalid,
textarea:user-invalid,
select:user-invalid {
  border-color: #b3261e;
  background-color: #fdf3f2;
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.14);
}

/* Ikon kalender/jam bisa diklik dan tidak terlalu pucat */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.75;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Tombol "Choose file" mengikuti warna tema */
input[type="file"] {
  max-width: 100%;
  padding: 0.4rem;
  border: 2px dashed var(--mrbs-line-strong);
  border-radius: var(--mrbs-radius);
  background-color: var(--mrbs-blue-tint);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 0.8rem;
  padding: 0.5rem 0.9rem;
  border: 0;
  border-radius: var(--mrbs-radius-sm);
  background-color: var(--mrbs-blue);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--mrbs-fast) ease;
}

input[type="file"]::file-selector-button:hover {
  background-color: var(--mrbs-blue-deep);
}

/* Isian otomatis browser (autofill) tidak merusak warna kolom */
input:-webkit-autofill,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--mrbs-ink);
  box-shadow: 0 0 0 100px var(--mrbs-blue-tint) inset;
}

/* Layar sentuh: target lebih besar */
@media (pointer: coarse) {
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="url"],
  input[type="tel"],
  input[type="search"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"],
  select:not([multiple]) {
    min-height: 3rem;
  }
}

/* HP: font 16px agar iOS tidak otomatis zoom saat kolom disentuh,
   dan tombol Simpan/Batal menempel di bawah layar pada form panjang */
@media (max-width: 40rem) {
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="url"],
  input[type="tel"],
  input[type="search"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"],
  select,
  textarea {
    font-size: 16px;
  }

  .standard fieldset:has(> div.submit_buttons) {
    position: sticky;
    bottom: env(safe-area-inset-bottom, 0px);
    z-index: 20;
    background-color: var(--mrbs-surface);
    box-shadow: 0 -8px 20px rgba(0, 55, 82, 0.12);
  }
}


/* ------------------------------------------------------------------ */
/* 19. Booking ganda: booking yang tumpang tindih tampil berdampingan   */
/*     (lajur), bukan ditumpuk ke bawah yang membuat baris membengkak   */
/* ------------------------------------------------------------------ */

.dwm_main .booked.multiply {
  padding: 0;
}

/* Tiap booking menjadi satu lajur; tinggi tetap satu slot (dari mrbs.css.php) */
.dwm_main .booked.multiply .booking {
  float: left;
  box-sizing: border-box;
  width: 100%;
  border-radius: 0;
}

/* Lebar lajur = 1 / jumlah booking dalam sel (2, 3, 4, 5 atau lebih) */
.dwm_main .booked.multiply .booking:first-child:nth-last-child(2),
.dwm_main .booked.multiply .booking:first-child:nth-last-child(2) ~ .booking {
  width: 50%;
}

.dwm_main .booked.multiply .booking:first-child:nth-last-child(3),
.dwm_main .booked.multiply .booking:first-child:nth-last-child(3) ~ .booking {
  width: 33.3334%;
}

.dwm_main .booked.multiply .booking:first-child:nth-last-child(4),
.dwm_main .booked.multiply .booking:first-child:nth-last-child(4) ~ .booking {
  width: 25%;
}

.dwm_main .booked.multiply .booking:first-child:nth-last-child(n+5),
.dwm_main .booked.multiply .booking:first-child:nth-last-child(n+5) ~ .booking {
  width: 20%;
}

/* Kartu lajur: ringkas, hanya judul satu baris; detail ada di tooltip/bubble saat hover */
.dwm_main .booked.multiply .booking a {
  display: block;
  box-sizing: border-box;
  height: 100%;
  padding: 0.2rem 0.4rem 0.2rem 0.55rem;
  border-bottom: 0;
  border-radius: 0;
  font-size: 0.78rem;
  line-height: 1.25;
  box-shadow: inset 4px 0 0 var(--bk-edge), inset 0 2px 0 rgba(255, 255, 255, 0.95);
}

.dwm_main .booked.multiply .booking a .bk-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dwm_main .booked.multiply .booking a .bk-meta,
.dwm_main .booked.multiply .booking a .bk-desc {
  display: none;
}

/* Lajur yang melanjutkan booking yang sama dari slot di atasnya (diberi class oleh theme.js):
   tanpa garis pemisah dan tanpa teks berulang, jadi tampil menyambung */
.dwm_main .booked.multiply .booking.bk-cont a {
  box-shadow: inset 4px 0 0 var(--bk-edge);
}

.dwm_main .booked.multiply .booking.bk-cont a .bk-title {
  visibility: hidden;
}
/* ------------------------------------------------------------------ */
/* Booking yang belum disetujui (menunggu persetujuan): abu-abu semua  */
/* tipe, sama dengan chip "Belum dikonfirmasi" pada legenda.           */
/* Spesifisitas sengaja lebih tinggi daripada aturan warna per tipe.   */
/* ------------------------------------------------------------------ */
.dwm_main .awaiting_approval a,
.dwm_main .awaiting_approval a[data-type] {
  --bk-bg: #d7dadd;
  --bk-edge: #6f777d;
  --bk-ink: #2f3a42;
  font-style: italic;
}
