/* ==========================================================================
   CSPC SpaceHub — Design System
   Single stylesheet. Tokens first, then base, components, layout, pages.
   No !important overrides: every rule is written once, in one place.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* Brand */
  --navy-900: #0b1f3d;
  --navy-800: #102a56;
  --navy-700: #1b3d73;
  --blue-600: #2563c9;
  --blue-700: #1d4fa3;
  --blue-100: #dbe8fb;
  --blue-50:  #eef4fe;
  --gold-500: #f4b942;
  --gold-600: #e0a62f;

  /* Neutrals */
  --ink:        #1b2a41;
  --ink-soft:   #3d4d66;
  --muted:      #64748b;
  --line:       #dde4ee;
  --line-soft:  #eaeff6;
  --canvas:     #f3f6fa;
  --surface:    #ffffff;
  --surface-2:  #f7f9fc;

  /* Status */
  --pending-bg:  #fff4d9; --pending-fg:  #7a5200; --pending-bd:  #f1dca3;
  --success-bg:  #e6f6ee; --success-fg:  #146440; --success-bd:  #bfe6d1;
  --danger-bg:   #fdecec; --danger-fg:   #a12a2a; --danger-bd:   #f2c7c7;
  --info-bg:     #eaf2ff; --info-fg:     #1f4f9c; --info-bd:     #c9dcf8;
  --warn-bg:     #fff0e6; --warn-fg:     #9a4311; --warn-bd:     #f5cfb4;
  --neutral-bg:  #eef1f5; --neutral-fg:  #4b5a70; --neutral-bd:  #d9dfe8;

  /* Shape & depth */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 42, 86, .06);
  --shadow:    0 2px 8px rgba(16, 42, 86, .07);
  --shadow-lg: 0 18px 48px rgba(8, 24, 52, .22);

  /* Type */
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-lg: 16px;

  /* Layout */
  --sidebar-w: 256px;
  --topbar-h: 64px;
  --page-pad: 32px;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; color: var(--navy-800); line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: var(--text-lg); font-weight: 700; }
p  { margin: 0 0 12px; }
a  { color: var(--blue-600); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--blue-700); }
small { font-size: var(--text-xs); }
strong { font-weight: 700; }
ul { padding-left: 20px; }
img, svg { max-width: 100%; }
.hidden { display: none !important; }
.muted  { color: var(--muted); }
.center { text-align: center; }
.full   { width: 100%; }

:focus-visible { outline: 3px solid rgba(37, 99, 201, .45); outline-offset: 2px; }

/* 3. Forms ----------------------------------------------------------------- */
label {
  display: block;
  margin: 16px 0 6px;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--ink-soft);
}
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #c7d2e1;
  border-radius: 8px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:hover, select:hover, textarea:hover { border-color: #a9b8cf; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 201, .15);
}
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 18px; height: 18px; padding: 0; accent-color: var(--blue-600); flex: none; }
.field-hint { display: block; margin-top: 6px; font-size: var(--text-xs); color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check-row { display: flex; flex-wrap: wrap; gap: 20px; margin: 16px 0 4px; }
.check, .terms-check { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 500; color: var(--ink-soft); }
.terms-check { align-items: flex-start; margin: 18px 0; font-size: var(--text-sm); }
.terms-check input { margin-top: 2px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin: 0; padding: 16px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer;
}
.setting-row:last-of-type { border-bottom: 0; }
.setting-row strong { display: block; color: var(--ink); }
.setting-row small  { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; }

/* 4. Buttons --------------------------------------------------------------- */
.primary, .secondary, .danger, .danger-outline, .button-link, .button-link-dark {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  font: inherit; font-size: var(--text-sm); font-weight: 700; line-height: 1;
  border: 1px solid transparent; border-radius: 8px;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.primary { background: var(--navy-800); color: #fff; }
.primary:hover { background: var(--navy-700); color: #fff; box-shadow: var(--shadow); transform: translateY(-1px); }
.secondary, .button-link-dark {
  background: #fff; color: var(--navy-800); border-color: #c7d2e1;
}
.secondary:hover, .button-link-dark:hover {
  background: var(--blue-50); border-color: var(--blue-600); color: var(--navy-800);
}
.danger { background: #b42323; color: #fff; }
.danger:hover { background: #961c1c; color: #fff; }
.danger-outline { background: #fff; color: #b42323; border-color: #e3b1b1; }
.danger-outline:hover { background: var(--danger-bg); border-color: #b42323; }
.primary.full, .danger.full { width: 100%; }
.primary:disabled, .secondary:disabled, button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.pressing { transform: scale(.98); }
.is-submitting { opacity: .75; cursor: wait; }
.text-button {
  padding: 4px 6px; font: inherit; font-size: var(--text-sm); font-weight: 700;
  color: var(--blue-600); background: none; border: 0; cursor: pointer;
}
.text-button:hover { text-decoration: underline; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline-form { display: inline; margin: 0; }

/* 5. Badges & tags --------------------------------------------------------- */
.badge, .facility-type, .audit-action, .unread-label {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border: 1px solid transparent; border-radius: 999px;
  font-size: 11px; font-weight: 750; line-height: 1.4; letter-spacing: .01em; white-space: nowrap;
}
.badge.pending                       { background: var(--pending-bg); color: var(--pending-fg); border-color: var(--pending-bd); }
.badge.approved, .badge.completed,
.badge.booked                        { background: var(--success-bg); color: var(--success-fg); border-color: var(--success-bd); }
.badge.rejected, .badge.cancelled,
.badge.suspended, .badge.disabled,
.badge.unavailable                   { background: var(--danger-bg);  color: var(--danger-fg);  border-color: var(--danger-bd); }
.badge.available, .badge.active,
.badge.scheduled                     { background: var(--info-bg);    color: var(--info-fg);    border-color: var(--info-bd); }
.badge.maintenance                   { background: var(--warn-bg);    color: var(--warn-fg);    border-color: var(--warn-bd); }
.badge.inactive                      { background: var(--neutral-bg); color: var(--neutral-fg); border-color: var(--neutral-bd); }
.facility-type { background: var(--blue-50); color: var(--navy-700); border-color: var(--blue-100); text-transform: uppercase; letter-spacing: .06em; font-size: 10px; }
.audit-action  { background: var(--neutral-bg); color: var(--neutral-fg); border-color: var(--neutral-bd); text-transform: capitalize; }
.unread-label  { background: var(--gold-500); color: var(--navy-900); padding: 2px 8px; font-size: 10px; letter-spacing: .06em; }

/* 6. Cards, notices, empty states ----------------------------------------- */
.card, .form-card, .stat-card, .room-card, .calendar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card { padding: 24px; margin-bottom: 20px; }
.card > h2:first-child, .card > h3:first-child { margin-bottom: 14px; }
.card h3 { margin-bottom: 8px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.card-heading p { margin: 4px 0 0; font-size: var(--text-sm); color: var(--muted); }
.card-heading a { font-size: var(--text-sm); font-weight: 700; white-space: nowrap; }
.card > .table-wrap { margin: 0; }

.notice {
  margin: 0 0 20px; padding: 14px 16px; font-size: var(--text-sm); line-height: 1.55;
  color: var(--info-fg); background: var(--info-bg);
  border: 1px solid var(--info-bd); border-left: 4px solid var(--blue-600); border-radius: var(--radius);
}
.notice.compact { margin: 16px 0 0; }
.rejection-note, .rejection-box {
  margin: 14px 0; padding: 12px 14px; font-size: var(--text-sm);
  color: var(--danger-fg); background: var(--danger-bg);
  border: 1px solid var(--danger-bd); border-left: 4px solid #c24141; border-radius: var(--radius);
}
.rejection-note p, .rejection-box p { margin: 4px 0 0; }

.flash {
  margin: 0 0 20px; padding: 13px 16px; font-size: var(--text-sm); font-weight: 600;
  border: 1px solid; border-radius: var(--radius);
  transition: opacity .25s ease, transform .25s ease;
}
.flash.success { color: var(--success-fg); background: var(--success-bg); border-color: var(--success-bd); }
.flash.error   { color: var(--danger-fg);  background: var(--danger-bg);  border-color: var(--danger-bd); }
.flash-fade { opacity: 0; transform: translateY(-4px); }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { margin-bottom: 16px; }

/* 7. App shell ------------------------------------------------------------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: var(--sidebar-w); height: 100vh; padding: 20px 14px;
  display: flex; flex-direction: column;
  color: #fff; background: var(--navy-900);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent;
}
.sidebar .brand { padding: 4px 10px 18px; margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar .brand strong { display: block; font-size: 17px; letter-spacing: -.01em; }
.sidebar .brand small  { display: block; margin-top: 3px; font-size: 11px; color: #9fb3d1; }
.sidebar nav { flex: 1; }
.sidebar nav a, .nav-button {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  margin: 2px 0; padding: 10px 12px;
  font: inherit; font-size: var(--text-sm); font-weight: 600; text-align: left;
  color: #c9d6ea; background: transparent; border: 0; border-radius: 8px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.sidebar nav a:hover, .nav-button:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a.active { color: #fff; background: rgba(37, 99, 201, .55); box-shadow: inset 3px 0 0 var(--gold-500); }
.nav-section { padding: 18px 12px 6px; font-size: 10px; font-weight: 800; letter-spacing: .12em; color: #8097ba; }
.nav-section:first-child { padding-top: 6px; }
.nav-badge, .topbar-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  font-size: 11px; font-weight: 800; color: var(--navy-900); background: var(--gold-500); border-radius: 999px;
}
.logout-form { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }

.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0; z-index: 20;
  height: var(--topbar-h); padding: 0 var(--page-pad);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-weight: 700; color: var(--navy-800);
  background: #fff; border-bottom: 1px solid var(--line);
}
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: var(--text-sm); font-weight: 500; color: var(--muted); }
.topbar-user strong { color: var(--navy-800); }
.notification-link { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; font-weight: 700; }

.app-main { min-height: 100vh; margin-left: var(--sidebar-w); padding: calc(var(--topbar-h) + 28px) var(--page-pad) 48px; }
.app-main > section { max-width: 1180px; }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading p { margin: 6px 0 0; font-size: var(--text-sm); color: var(--muted); max-width: 640px; }
.eyebrow { margin-bottom: 6px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-600); }

/* 8. Stats & dashboard ----------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 20px; }
.stat-card span { display: block; font-size: var(--text-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.stat-card strong { display: block; margin-top: 8px; font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--navy-800); }

.dashboard-hero {
  margin-bottom: 24px; padding: 30px 32px; color: #fff;
  background: linear-gradient(120deg, var(--navy-800) 0%, var(--navy-700) 70%, #24569f 100%);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.dashboard-hero .eyebrow { color: #a9d3ff; }
.dashboard-hero h1 { color: #fff; font-size: 28px; }
.dashboard-hero p { max-width: 560px; margin: 8px 0 20px; color: #d6e3f5; }
.dashboard-hero .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dashboard-hero .primary { background: var(--gold-500); color: var(--navy-900); }
.dashboard-hero .primary:hover { background: #ffc85e; }
.dashboard-hero .button-link-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.dashboard-hero .button-link-dark:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }

.admin-grid { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.admin-detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.admin-grid > .card, .admin-detail-grid > .card, .admin-grid > form.card { margin-bottom: 0; }
.mini-stat { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.mini-stat:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-stat span { color: var(--muted); font-size: var(--text-sm); }
.mini-stat strong { font-size: var(--text-lg); color: var(--navy-800); }

/* 9. Tables ---------------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table-wrap table { width: 100%; min-width: 640px; border-collapse: collapse; }
.table-wrap th {
  padding: 12px 16px; text-align: left; white-space: nowrap;
  font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: #52627a; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.table-wrap td { padding: 14px 16px; vertical-align: middle; font-size: var(--text-sm); color: var(--ink-soft); border-bottom: 1px solid var(--line-soft); }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover td { background: #f8fbff; }
.table-wrap td strong { color: var(--navy-800); white-space: nowrap; }
.table-wrap td small { display: block; margin-top: 2px; color: var(--muted); }
.table-wrap td a { font-weight: 700; }
.table-wrap td .empty { padding: 28px 12px; }
.table-wrap td.muted.center { padding: 32px 16px; }

.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-tabs a {
  padding: 8px 14px; font-size: var(--text-sm); font-weight: 650; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.filter-tabs a:hover { border-color: var(--blue-600); background: var(--blue-50); }
.filter-tabs a.active { color: #fff; background: var(--navy-800); border-color: var(--navy-800); }

/* 10. Facilities ----------------------------------------------------------- */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.room-card { display: flex; flex-direction: column; gap: 10px; padding: 22px; transition: box-shadow .2s ease, transform .2s ease; }
.room-card:hover { box-shadow: 0 10px 28px rgba(16,42,86,.12); transform: translateY(-2px); }
.room-card .facility-type { align-self: flex-start; }
.room-card h2 { font-size: 18px; }
.room-card p { flex: 1; margin: 0; font-size: var(--text-sm); color: var(--muted); }
.room-meta, .facility-info { display: flex; flex-wrap: wrap; gap: 8px; }
.room-meta { padding-top: 14px; border-top: 1px solid var(--line-soft); }
.room-meta span, .facility-info span {
  padding: 4px 10px; font-size: var(--text-xs); font-weight: 600; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
}
.facility-info { margin-top: 12px; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.facility-info span { background: #fff; }
.card .facility-info { margin: 0 0 18px; padding: 0; background: none; border: 0; }

/* 11. Reservation flow ----------------------------------------------------- */
.form-card { padding: 28px; margin-bottom: 20px; }
.form-card h2 { margin-bottom: 4px; }
.form-card > .muted { margin-bottom: 8px; }
.reservation-page .form-card { max-width: 920px; }
.section-title { display: flex; align-items: center; gap: 14px; margin: 28px 0 4px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.section-title strong { display: block; color: var(--navy-800); font-size: var(--text-lg); }
.section-title small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-sm); }
.step-number {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px;
  font-weight: 800; color: #fff; background: var(--navy-800); border-radius: 50%;
}
.form-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line-soft);
}
.form-footer form { margin: 0; }
.form-footer .muted { font-size: var(--text-sm); }

.availability-panel { margin-top: 20px; padding: 20px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.availability-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.availability-header h3 { margin-bottom: 4px; }
.availability-header p { margin: 0; font-size: var(--text-sm); color: var(--muted); }
.availability-error { padding: 20px; text-align: center; font-size: var(--text-sm); color: var(--danger-fg); background: var(--danger-bg); border: 1px solid var(--danger-bd); border-radius: var(--radius); }

.review-card { max-width: 900px; }
.review-header, .detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.review-header h2, .detail-header h2 { margin: 10px 0 4px; font-size: 22px; }
.review-header p { margin: 0; font-size: var(--text-sm); color: var(--muted); }
.review-grid, .detail-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 20px; padding: 22px 0; }
.review-grid span, .detail-fields span, .detail-grid span, .detail-block span, .review-details > span,
.profile-meta span, .detail-reference span, .reference span, .reference-card span, .meta-list dt {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.review-grid strong, .detail-fields strong, .detail-grid strong, .profile-meta strong { display: block; margin-top: 4px; color: var(--ink); }
.review-details, .detail-section, .detail-block { padding-top: 20px; border-top: 1px solid var(--line-soft); margin-bottom: 18px; }
.review-details p, .detail-section p, .detail-block p { margin: 6px 0 0; line-height: 1.65; color: var(--ink-soft); }
.detail-section h3 { margin-bottom: 4px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.admin-detail-grid .detail-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 4px 0 20px; }
.detail-grid > div small { display: block; color: var(--muted); }
.detail-reference, .reference-card {
  margin: 18px 0 0; padding: 14px 18px; background: var(--blue-50); border: 1px dashed #9db9e2; border-radius: var(--radius);
}
.detail-reference strong, .reference-card strong { display: block; margin-top: 4px; font-size: 20px; letter-spacing: .04em; color: var(--navy-800); }
.detail-side h3:not(:first-child) { margin-top: 20px; }

.reservation-list { display: flex; flex-direction: column; }
.reservation-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.reservation-item:first-child { padding-top: 0; }
.reservation-item:last-child { padding-bottom: 0; border-bottom: 0; }
.reservation-main { flex: 1; min-width: 0; }
.reservation-title-row { display: flex; align-items: center; gap: 8px; }
.reservation-item h2 { margin: 10px 0 6px; font-size: 18px; }
.reservation-item h2 a { color: var(--navy-800); }
.reservation-item h2 a:hover { color: var(--blue-600); }
.reservation-item p { margin: 3px 0; font-size: var(--text-sm); }
.reservation-actions form { margin: 0; }
.reference { min-width: 170px; text-align: right; }
.reference strong { display: block; margin-top: 4px; font-size: var(--text-sm); color: var(--navy-800); }

.success-page { max-width: 560px; margin: 32px auto; padding: 40px 32px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.success-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 20px; background: var(--success-bg); border-radius: 50%; }
.success-icon svg { width: 40px; height: 40px; fill: none; stroke: var(--success-fg); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.success-page h1 { margin-bottom: 8px; }
.success-page > p { color: var(--muted); }
.reference-card { max-width: 380px; margin: 22px auto; }
.success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }

/* 12. Calendar ------------------------------------------------------------- */
.calendar-card { padding: 0; overflow: hidden; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.calendar-toolbar > div { text-align: center; }
.calendar-toolbar h2 { font-size: 20px; }
.today-link { display: inline-block; margin-top: 2px; font-size: var(--text-xs); font-weight: 700; }
.calendar-nav { display: grid; place-items: center; width: 38px; height: 38px; font-size: 18px; color: var(--navy-800); background: #fff; border: 1px solid #c7d2e1; border-radius: 8px; }
.calendar-nav:hover { background: var(--blue-50); border-color: var(--blue-600); color: var(--navy-800); }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.calendar-weekdays > div { padding: 10px 8px; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #52627a; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-cell { min-height: 124px; padding: 8px; background: #fff; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell.blank { background: var(--surface-2); }
.calendar-cell.today { background: var(--blue-50); box-shadow: inset 0 0 0 2px var(--blue-600); }
.day-number { margin-bottom: 6px; font-size: var(--text-sm); font-weight: 700; color: var(--ink-soft); }
.calendar-cell.today .day-number { color: var(--blue-700); }
.calendar-events { display: flex; flex-direction: column; gap: 4px; }
.calendar-event {
  display: block; padding: 4px 7px; overflow: hidden; line-height: 1.3;
  border-left: 3px solid; border-radius: 5px;
}
.calendar-event strong { display: block; font-size: 11px; }
.calendar-event span   { display: block; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.calendar-event small  { display: block; font-size: 10px; opacity: .85; }
a.calendar-event:hover { filter: brightness(.96); }
.calendar-event.pending     { color: var(--pending-fg); background: var(--pending-bg); border-color: #e3a32a; }
.calendar-event.approved,
.calendar-event.booked      { color: var(--info-fg); background: var(--info-bg); border-color: var(--blue-600); }
.calendar-event.maintenance { color: var(--warn-fg); background: var(--warn-bg); border-color: #d76a35; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 20px; padding: 14px 24px; font-size: var(--text-xs); color: var(--muted); border-top: 1px solid var(--line); }
.calendar-legend span { display: inline-flex; align-items: center; gap: 7px; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.pending-dot { background: #e3a32a; }
.approved-dot { background: var(--blue-600); }
.maintenance-dot { background: #d76a35; }

/* 13. Admin extras --------------------------------------------------------- */
.requester { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.requester strong { display: block; }
.requester span { font-size: var(--text-sm); color: var(--muted); text-transform: capitalize; }
.avatar, .avatar-large { display: grid; place-items: center; flex: none; font-weight: 800; color: #fff; background: var(--navy-800); border-radius: 50%; }
.avatar { width: 44px; height: 44px; font-size: var(--text-lg); }
.avatar-large { width: 76px; height: 76px; margin: 0 auto 14px; font-size: 26px; }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 20px; padding: 14px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.meta-list dt { align-self: center; }
.meta-list dd { margin: 0; font-size: var(--text-sm); word-break: break-word; }
.reject-form { margin-top: 20px; padding-top: 4px; border-top: 1px solid var(--line-soft); }
.reject-form .danger { margin-top: 12px; }
.admin-detail-grid form { margin: 0; }
.maintenance-list { display: flex; flex-direction: column; }
.maintenance-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.maintenance-item:last-child { border-bottom: 0; }
.maintenance-item strong, .maintenance-item span, .maintenance-item small { display: block; }
.maintenance-item span { font-size: var(--text-sm); color: var(--ink-soft); }
.maintenance-item small { color: var(--muted); }
.maintenance-actions { display: flex; align-items: center; gap: 10px; }
.danger-text { color: var(--danger-fg); font-weight: 700; }
.section-title ~ .form-footer { margin-top: 28px; }

/* 14. Account pages -------------------------------------------------------- */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.security-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-grid > .card, .security-grid > .card { margin-bottom: 0; }
.profile-summary { text-align: center; }
.profile-summary p { color: var(--muted); }
.profile-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; padding-top: 18px; text-align: left; border-top: 1px solid var(--line-soft); }
.security-info ul { margin: 0; color: var(--ink-soft); font-size: var(--text-sm); }
.security-info li { margin-bottom: 8px; }
.settings-card { max-width: 760px; }

.notification-list { padding: 0; overflow: hidden; }
.notification-item { display: flex; align-items: flex-start; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--line-soft); }
.notification-item:last-child { border-bottom: 0; }
.notification-item.unread { background: var(--blue-50); }
.notification-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; font-weight: 800; color: var(--muted); background: var(--neutral-bg); border-radius: 50%; }
.notification-item.unread .notification-icon { color: var(--navy-900); background: var(--gold-500); }
.notification-content { flex: 1; min-width: 0; }
.notification-title-row { display: flex; align-items: center; gap: 10px; }
.notification-content p { margin: 4px 0; font-size: var(--text-sm); color: var(--ink-soft); }
.notification-content small { color: var(--muted); }
.notification-item form { margin: 0; }

/* 15. Public pages: landing, auth, terms, errors --------------------------- */
.public-main { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 32px 20px; }
.public-main > .flash { width: min(440px, 100%); box-shadow: var(--shadow); }
.public-main.landing-main { display: block; height: 100vh; height: 100svh; min-height: 620px; padding: 0; overflow: hidden; background: var(--navy-900); }

.brand-mark {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px;
  font-weight: 800; letter-spacing: .02em; color: #fff; background: var(--navy-800); border-radius: 12px;
}
.brand-center { margin-bottom: 24px; text-align: center; }
.brand-center .brand-mark { margin: 0 auto 12px; }
.brand-center h1 { font-size: 24px; }
.brand-center p { margin: 4px 0 0; font-size: var(--text-sm); color: var(--muted); }

.auth-card, .public-card {
  width: min(440px, 100%); padding: 32px;
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--gold-500);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.register-card { width: min(520px, 100%); }
.auth-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.auth-heading h1 { font-size: 22px; }
.auth-heading p { margin: 2px 0 0; }
.login-heading { margin-bottom: 4px; text-align: center; }
.login-heading h2 { font-size: 20px; }
.login-heading p { margin: 4px 0 0; font-size: var(--text-sm); color: var(--muted); }
.login-form .primary, .register-form .primary { min-height: 46px; margin-top: 8px; font-size: var(--text-md); }
.login-register { margin: 20px 0 0; font-size: var(--text-sm); }
.register-form .field-hint { margin: 6px 0 0; }

/* Login / register use the same campus background and overlay as the landing hero. */
.public-main.auth-page {
  background:
    linear-gradient(100deg, rgba(5, 24, 44, .94) 0%, rgba(8, 36, 72, .78) 50%, rgba(37, 99, 201, .35) 100%),
    var(--navy-900) url("/images/cspc-campus-bg.png") center 46% / cover no-repeat fixed;
}

.terms-card { width: min(820px, 100%); border-top-color: var(--gold-500); }
.terms-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.terms-header h1 { font-size: 24px; }
.terms-header p { margin: 4px 0 0; }
.terms-content h2 { margin: 22px 0 8px; font-size: var(--text-lg); }
.terms-content p, .terms-content li { font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.7; }
.terms-actions { display: flex; justify-content: flex-end; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft); }

.error-page { max-width: 460px; padding: 48px 32px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.error-page h1 { margin-bottom: 4px; font-size: 64px; letter-spacing: -.04em; color: var(--blue-600); }
.error-page h2 { margin-bottom: 8px; }
.error-page p { margin-bottom: 22px; color: var(--muted); }

/* Landing */
.landing-page { min-height: 100vh; display: flex; flex-direction: column; color: #fff; background: #fff; }
.landing-nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10; min-height: 78px; padding: 12px 5vw;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border-bottom: 1px solid rgba(255,255,255,.16); background: rgba(7,25,48,.18);
  backdrop-filter: blur(8px);
}
.landing-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; }
.landing-brand:hover { color: #fff; }
.brand-mark, .card-mark {
  display: inline-grid; place-items: center; flex: none; width: 42px; height: 42px;
  color: var(--navy-900); background: var(--gold-500); border-radius: 12px;
  font-size: 14px; font-weight: 900; letter-spacing: -.04em;
}
.landing-brand strong { display: block; font-size: 17px; letter-spacing: -.02em; }
.landing-brand small { display: block; margin-top: 2px; font-size: 11px; color: rgba(255,255,255,.76); }
.landing-nav-actions { display: flex; align-items: center; gap: 24px; }
.landing-nav-link { color: rgba(255,255,255,.88); font-size: 13px; font-weight: 700; }
.landing-nav-link:hover { color: var(--gold-500); }
.landing-login {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 0 20px;
  font-size: 13px; font-weight: 800; color: var(--navy-800); background: #fff; border-radius: 8px;
  transition: background .15s ease, transform .15s ease;
}
.landing-login:hover { background: var(--gold-500); color: var(--navy-900); transform: translateY(-1px); }
.landing-hero {
  position: relative; flex: none; display: flex; align-items: center; justify-content: space-between; gap: clamp(30px, 6vw, 88px);
  min-height: 690px; padding: 132px 7vw 88px;
  background: var(--navy-900) url("/images/cspc-campus-bg.png") center 46% / cover no-repeat;
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,20,40,.92) 0%, rgba(5,20,40,.82) 48%, rgba(5,20,40,.55) 100%); }
.hero-content, .availability-card { position: relative; z-index: 2; }
.hero-content { width: min(650px, 58%); }
.landing-eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-size: 10px; font-weight: 850; letter-spacing: .17em; color: #d6e5fa; }
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-500); box-shadow: 0 0 0 5px rgba(244,185,66,.16); }
.hero-content h1 { color: #fff; font-size: clamp(44px, 5.4vw, 76px); font-weight: 850; line-height: 1.02; letter-spacing: -.05em; }
.hero-content h1 em { color: var(--gold-500); font-style: normal; }
.hero-content > p { max-width: 560px; margin: 22px 0 30px; font-size: clamp(15px, 1.3vw, 18px); line-height: 1.7; color: #e1e9f4; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-primary, .hero-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 50px; padding: 0 22px;
  font-size: 13px; font-weight: 800; border-radius: 9px; border: 1px solid transparent;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.hero-primary { color: var(--navy-900); background: var(--gold-500); }
.hero-primary:hover { color: var(--navy-900); background: #ffc85e; transform: translateY(-2px); }
.hero-secondary { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.55); }
.hero-secondary:hover { color: #fff; background: rgba(255,255,255,.18); border-color: #fff; }
.hero-note { display: flex; align-items: center; gap: 8px; margin-top: 22px; font-size: 12px; color: #c5d3e6; }
.hero-note span { display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--navy-900); background: var(--gold-500); border-radius: 50%; font-weight: 900; }
.landing-bottom-note { position: absolute; left: 7vw; bottom: 24px; z-index: 2; font-size: 10px; letter-spacing: .06em; color: #c4d2e5; }
.landing-bottom-note span { font-weight: 850; color: var(--gold-500); letter-spacing: .14em; }
.availability-card {
  width: min(410px, 39%); flex: none; padding: 26px; color: var(--ink); background: #fff;
  border: 1px solid rgba(255,255,255,.55); border-top: 4px solid var(--gold-500);
  border-radius: 16px; box-shadow: 0 24px 65px rgba(0,0,0,.28);
}
.availability-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.availability-top h2 { max-width: 240px; margin-top: 7px; font-size: 21px; line-height: 1.2; }
.mini-label { display: block; font-size: 9px; font-weight: 850; letter-spacing: .14em; color: var(--muted); }
.card-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 12px; }
.landing-capabilities { margin: 17px 0 14px; }
.landing-capability { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.capability-icon { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; color: var(--blue-700); background: var(--blue-50); border-radius: 9px; font-size: 18px; font-weight: 800; }
.landing-capability strong { display: block; font-size: 13px; color: var(--navy-800); }
.landing-capability span:not(.capability-icon) { display: block; margin-top: 3px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.landing-availability { padding-top: 7px; }
.availability-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 3px; }
.availability-heading a { font-size: 11px; font-weight: 800; white-space: nowrap; }
.landing-room { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.landing-room:last-child { border-bottom: 0; }
.landing-room strong { display: block; font-size: 12px; color: var(--ink); }
.landing-room small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.landing-room b { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; color: var(--success-fg); white-space: nowrap; }
.landing-room b span { font-size: 7px; }
.landing-how { display: grid; grid-template-columns: minmax(230px, .9fr) minmax(0, 1.5fr); gap: clamp(32px, 7vw, 100px); align-items: center; max-width: 1240px; width: 100%; margin: 0 auto; padding: 88px 7vw 92px; color: var(--ink); }
.landing-section-kicker { display: block; margin-bottom: 14px; color: var(--blue-600); font-size: 10px; font-weight: 850; letter-spacing: .15em; }
.landing-section-intro h2 { font-size: clamp(28px, 3vw, 39px); line-height: 1.12; letter-spacing: -.04em; color: var(--navy-900); }
.landing-section-intro h2 em { color: var(--blue-600); font-style: normal; }
.landing-section-intro p { max-width: 360px; margin: 15px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.landing-steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.landing-step { min-height: 170px; padding: 20px 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.step-number { display: center; margin-bottom: 28px; color: var(--blue-600); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.landing-step h3 { margin-bottom: 7px; color: var(--navy-800); font-size: 14px; }
.landing-step p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.landing-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 7vw; color: #c5d3e6; background: var(--navy-900); font-size: 11px; }
.landing-footer strong { color: #fff; }
.landing-footer a { color: var(--gold-500); font-weight: 800; white-space: nowrap; }
.landing-footer a:hover { color: #ffd47d; }
/* 16. Motion (restrained) -------------------------------------------------- */
.motion-ready { opacity: 0; transform: translateY(8px); transition: opacity .45s ease var(--motion-delay, 0ms), transform .45s ease var(--motion-delay, 0ms); }
.motion-ready.motion-visible { opacity: 1; transform: none; }

/* 17. Responsive ----------------------------------------------------------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .admin-grid, .admin-detail-grid, .detail-grid, .profile-grid, .security-grid { grid-template-columns: 1fr; }
  .landing-hero { gap: 28px; }
  .hero-content { width: 56%; }
  .availability-card { width: 42%; padding: 22px; }
}
@media (max-width: 900px) {
  :root { --page-pad: 20px; }
  .sidebar { position: static; width: 100%; height: auto; padding: 12px 14px; flex-direction: column; }
  .sidebar .brand { padding: 2px 4px 10px; margin-bottom: 8px; }
  .sidebar nav { flex: none; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav a { flex: none; width: auto; padding: 8px 12px; white-space: nowrap; gap: 8px; }
  .nav-section { display: none; }
  .logout-form { margin: 8px 0 0; padding-top: 8px; }
  .logout-form .nav-button { padding: 8px 12px; }
  .topbar { position: static; height: auto; min-height: 52px; margin: calc(-1 * 24px) calc(-1 * var(--page-pad)) 20px; padding: 12px var(--page-pad); flex-wrap: wrap; }
  .app-main { margin-left: 0; padding: 24px var(--page-pad) 40px; }
  .review-grid, .detail-fields { grid-template-columns: 1fr 1fr; }

  .public-main.landing-main { height: auto; min-height: 100vh; overflow: visible; }
  .landing-page { height: auto; min-height: 100vh; }
  .landing-hero { flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 110px 20px 72px; }
  .hero-overlay { background: rgba(5, 24, 44, .84); }
  .hero-content, .availability-card { width: 100%; max-width: 560px; }
  .landing-bottom-note { left: 20px; }
}
@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .page-heading, .availability-header, .form-footer, .reservation-item, .review-header, .detail-header, .card-heading { flex-direction: column; align-items: stretch; }
  .two-col, .stats, .review-grid, .detail-fields, .admin-detail-grid .detail-grid, .profile-meta { grid-template-columns: 1fr; }
  .form-card, .card { padding: 18px; }
  .reference { text-align: left; }
  .primary, .secondary, .danger, .danger-outline, .button-link, .button-link-dark { width: 100%; }
  .table-wrap table { min-width: 600px; }
  .calendar-cell { min-height: 84px; padding: 4px; }
  .calendar-event small { display: none; }
  .calendar-event span, .calendar-event strong { font-size: 9px; }
  .calendar-weekdays > div { padding: 8px 2px; font-size: 9px; overflow: hidden; text-overflow: ellipsis; }
  .auth-card, .public-card { padding: 24px 20px; }
  .landing-nav { padding: 0 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .motion-ready { opacity: 1; transform: none; }
}

/* 18. Table-embedded controls --------------------------------------------- */
.table-wrap select { width: auto; min-height: 34px; padding: 6px 10px; font-size: var(--text-sm); }

/* Cards that only wrap a table: let the table fill the card edge to edge. */
.card:has(> .table-wrap:only-child) { padding: 0; overflow: hidden; }
.card:has(> .table-wrap:only-child) > .table-wrap { border: 0; border-radius: 0; }
/* Compact tables inside side-by-side admin cards should fit, not scroll. */
.admin-grid .table-wrap table { min-width: 0; }
.admin-grid .table-wrap th, .admin-grid .table-wrap td { padding-left: 12px; padding-right: 12px; }
.reservation-page .notice { max-width: 920px; }

/* 19. Enhancements: icons, depth, polish ---------------------------------- */
.sidebar nav a, .nav-button { justify-content: flex-start; gap: 12px; }
.sidebar nav a::before, .nav-button::before { content: ""; flex: none; width: 18px; height: 18px; background: currentColor; opacity: .85; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.sidebar nav a.active::before { opacity: 1; }
.sidebar nav a .nav-badge { margin-left: auto; }
.sidebar nav a[href="/dashboard"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9'/%3E%3Crect x='14' y='3' width='7' height='5'/%3E%3Crect x='14' y='12' width='7' height='9'/%3E%3Crect x='3' y='16' width='7' height='5'/%3E%3C/svg%3E"); }
.sidebar nav a[href="/reservations/new"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E"); }
.sidebar nav a[href="/reservations/my"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11l3 3L22 4'/%3E%3Cpath d='M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11'/%3E%3C/svg%3E"); }
.sidebar nav a[href="/rooms"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V7l7-4 7 4v14'/%3E%3Cpath d='M9 21v-6h6v6'/%3E%3C/svg%3E"); }
.sidebar nav a[href="/calendar"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
.sidebar nav a[href="/admin/requests"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M9 15l2 2 4-4'/%3E%3C/svg%3E"); }
.sidebar nav a[href="/admin/rooms"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2l9 5-9 5-9-5z'/%3E%3Cpath d='M3 12l9 5 9-5M3 17l9 5 9-5'/%3E%3C/svg%3E"); }
.sidebar nav a[href="/admin/maintenance"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.5 2.5-2.4-.6-.6-2.4z'/%3E%3C/svg%3E"); }
.sidebar nav a[href="/admin/users"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8'/%3E%3C/svg%3E"); }
.sidebar nav a[href="/admin/reports"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 20V10M12 20V4M6 20v-6'/%3E%3C/svg%3E"); }
.sidebar nav a[href="/admin/audit"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E"); }
.sidebar nav a[href="/notifications"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.7 21a2 2 0 0 1-3.4 0'/%3E%3C/svg%3E"); }
.sidebar nav a[href="/profile"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"); }
.sidebar nav a[href="/settings"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E"); }
.nav-button { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' 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"); }

.sidebar .brand { display: flex; align-items: center; gap: 12px; }
.sidebar .brand-mark { width: 38px; height: 38px; font-size: 13px; background: linear-gradient(135deg, var(--blue-600), var(--navy-700)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.sidebar .brand span { min-width: 0; }
.topbar { background: rgba(255,255,255,.88); backdrop-filter: saturate(1.4) blur(10px); }
.topbar-user .avatar-sm { display: grid; place-items: center; width: 32px; height: 32px; font-size: 12px; font-weight: 800; color: #fff; background: var(--navy-800); border-radius: 50%; }
.topbar-user .who { display: flex; flex-direction: column; line-height: 1.25; text-align: right; }
.topbar-user .who small { color: var(--muted); text-transform: capitalize; }
::selection { background: var(--blue-100); }

/* Depth & accents */
.stat-card { position: relative; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.stat-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--blue-600); }
.stat-card:nth-child(2)::before { background: #2f9e6b; }
.stat-card:nth-child(3)::before { background: var(--gold-500); }
.stat-card:nth-child(4)::before { background: #7b6cd9; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,42,86,.1); }
.card, .form-card { box-shadow: 0 1px 2px rgba(16,42,86,.04), 0 4px 14px rgba(16,42,86,.05); }
.dashboard-hero { position: relative; overflow: hidden; }
.dashboard-hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(244,185,66,.28), transparent 70%); pointer-events: none; }
.page-heading h1 { position: relative; }

/* Tables */
.table-wrap th { position: sticky; top: 0; }
.table-wrap tbody tr { transition: background .12s ease; }
.table-wrap td:first-child strong { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.table-wrap td:last-child a { display: inline-flex; padding: 5px 12px; border: 1px solid var(--blue-100); border-radius: 6px; background: var(--blue-50); }
.table-wrap td:last-child a:hover { background: var(--blue-100); }

/* Calendar */
.calendar-cell:nth-child(7n), .calendar-cell:nth-child(7n-1) { background-color: #fbfcfe; }
.calendar-cell.blank { background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(100,116,139,.05) 8px 9px); }
.calendar-cell.today .day-number { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; color: #fff; background: var(--blue-600); border-radius: 999px; }
.calendar-cell:hover:not(.blank) { background: #f8fbff; }

/* Rooms & forms */
.room-card { border-top: 3px solid transparent; }
.room-card:hover { border-top-color: var(--gold-500); }
.step-number { background: linear-gradient(135deg, var(--blue-600), var(--navy-800)); box-shadow: 0 2px 6px rgba(37,99,201,.35); }

/* Auth: split brand header on the card */
.auth-card, .public-card { backdrop-filter: blur(2px); }
.brand-center .brand-mark { width: 56px; height: 56px; font-size: 17px; border-radius: 14px; background: linear-gradient(135deg, var(--blue-600), var(--navy-800)); box-shadow: 0 6px 16px rgba(16,42,86,.3); }
.login-heading { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }

/* 20. Glass (public pages only) -------------------------------------------
   Frosted surfaces are limited to the landing page and the auth cards, where a
   photo sits behind them. Everything inside the app stays on solid surfaces. */
.public-main.auth-page .auth-card,
.public-main.auth-page .public-card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .55);
  border-top: 4px solid var(--gold-500);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 24px 60px rgba(4, 16, 36, .45), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.public-main.auth-page input { background: rgba(255, 255, 255, .92); }
.public-main.auth-page > .flash { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

.landing-page .availability-card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .55);
  border-top: 4px solid var(--gold-500);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: 0 24px 60px rgba(4, 16, 36, .5), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.landing-nav {
  background: rgba(8, 29, 61, .35);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.hero-secondary { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* Fall back to solid surfaces where blur isn't supported or users opt out. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .public-main.auth-page .auth-card, .public-main.auth-page .public-card, .landing-page .availability-card { background: #fff; }
  .landing-nav { background: rgba(8, 29, 61, .85); }
}
@media (prefers-reduced-transparency: reduce) {
  .public-main.auth-page .auth-card, .public-main.auth-page .public-card, .landing-page .availability-card { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .landing-nav { background: rgba(8, 29, 61, .92); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* 21. Tables & charts ------------------------------------------------------ */
/* Tables */
.table-wrap { box-shadow: inset 0 0 0 0 transparent; }
.table-wrap th { background: linear-gradient(180deg, #f9fbfe, #f1f5fa); border-bottom: 1px solid #d5deea; }
.table-wrap tbody tr:nth-child(even) td { background: #fafcfe; }
.table-wrap tbody tr:hover td { background: #f1f7ff; }
.table-wrap td:first-child, .table-wrap th:first-child { padding-left: 20px; }
.table-wrap td:last-child, .table-wrap th:last-child { padding-right: 20px; }
.table-wrap .num, .table-wrap td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap td.num { font-weight: 700; color: var(--navy-800); }
/* Status accent on the first cell of a row, driven by the badge in that row */
.table-wrap tbody tr td:first-child { box-shadow: inset 3px 0 0 transparent; }
.table-wrap tbody tr:has(.badge.pending) td:first-child { box-shadow: inset 3px 0 0 #e3a32a; }
.table-wrap tbody tr:has(.badge.approved) td:first-child,
.table-wrap tbody tr:has(.badge.completed) td:first-child { box-shadow: inset 3px 0 0 #2f9e6b; }
.table-wrap tbody tr:has(.badge.rejected) td:first-child,
.table-wrap tbody tr:has(.badge.cancelled) td:first-child,
.table-wrap tbody tr:has(.badge.suspended) td:first-child { box-shadow: inset 3px 0 0 #c24141; }
.table-wrap tbody tr:has(.badge.maintenance) td:first-child { box-shadow: inset 3px 0 0 #d76a35; }
/* Audit details: keep long text tidy */
.table-wrap td:nth-last-child(2) { max-width: 320px; }
.table-wrap td:last-child { font-variant-numeric: tabular-nums; }
.audit-action { font-family: inherit; }

/* Bar charts */
.report-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: stretch; margin-bottom: 20px; }
.report-grid > .card { margin-bottom: 0; }
.bar-list { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.bar-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 7px; }
.bar-rank { flex: none; display: grid; place-items: center; width: 24px; height: 24px; font-size: 11px; font-weight: 800; color: var(--navy-700); background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 50%; }
.bar-list li:first-child .bar-rank { color: var(--navy-900); background: var(--gold-500); border-color: var(--gold-600); }
.bar-name { flex: 1; min-width: 0; font-size: var(--text-sm); font-weight: 650; color: var(--ink); }
.bar-name small { display: block; font-weight: 500; color: var(--muted); }
.bar-value { font-size: var(--text-lg); font-variant-numeric: tabular-nums; color: var(--navy-800); }
.bar-track { height: 10px; overflow: hidden; background: var(--line-soft); border-radius: 999px; }
.bar-track.slim { height: 8px; min-width: 120px; }
.bar-fill { width: var(--pct, 0%); height: 100%; background: linear-gradient(90deg, var(--blue-600), #4c8dea); border-radius: 999px; transform-origin: left; animation: bar-grow .7s cubic-bezier(.2, .8, .2, 1) both; }
.bar-list li:first-child .bar-fill { background: linear-gradient(90deg, var(--gold-600), var(--gold-500)); }
.bar-cell { width: 34%; }
@keyframes bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.donut {
  --a-end: 0; --c-end: 0; --r-end: 0;
  flex: none; position: relative; width: 190px; height: 190px; border-radius: 50%;
  background: conic-gradient(
    #2f9e6b 0 calc(var(--a-end) * 1%),
    #2563c9 calc(var(--a-end) * 1%) calc(var(--c-end) * 1%),
    #c24141 calc(var(--c-end) * 1%) calc(var(--r-end) * 1%),
    #f1c15c calc(var(--r-end) * 1%) 100%);
}
.donut-hole { position: absolute; inset: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-soft); }
.donut-hole strong { font-size: 32px; line-height: 1; letter-spacing: -.03em; color: var(--navy-800); }
.donut-hole span { margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chart-legend { flex: 1; min-width: 190px; margin: 0; padding: 0; list-style: none; }
.chart-legend li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: var(--text-sm); }
.chart-legend li:last-child { border-bottom: 0; }
.legend-dot { flex: none; width: 12px; height: 12px; border-radius: 4px; }
.dot-approved { background: #2f9e6b; } .dot-completed { background: #2563c9; } .dot-rejected { background: #c24141; } .dot-other { background: #f1c15c; }
.legend-label { flex: 1; color: var(--ink-soft); }
.chart-legend strong { color: var(--navy-800); font-variant-numeric: tabular-nums; }
.chart-legend small { width: 38px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* System overview rows get a share bar */
.mini-stat { gap: 12px; }

@media (max-width: 1100px) { .report-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .donut { width: 160px; height: 160px; } .donut-hole { inset: 22px; } .bar-cell { display: none; } }
@media (prefers-reduced-motion: reduce) { .bar-fill { animation: none; } }

/* 22. Split bars (dashboard overview) -------------------------------------- */
.split-block { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.split-block:last-child { padding-bottom: 0; border-bottom: 0; }
.split-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; font-size: var(--text-sm); color: var(--muted); }
.split-head strong { font-size: 22px; letter-spacing: -.02em; color: var(--navy-800); }
.split-bar { display: flex; height: 10px; overflow: hidden; background: var(--line-soft); border-radius: 999px; }
.split-bar .seg { height: 100%; }
.split-bar .seg-a { width: var(--pct, 50%); background: var(--blue-600); }
.split-bar .seg-b { flex: 1; background: var(--gold-500); }
.split-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: var(--text-xs); color: var(--muted); }
.split-legend span { display: inline-flex; align-items: center; gap: 6px; }
.split-legend b { color: var(--navy-800); }
.legend-dot.seg-a { background: var(--blue-600); }
.legend-dot.seg-b { background: var(--gold-500); }

/* 23. Card shine ----------------------------------------------------------
   Static: every card gets a faint top-edge highlight.
   Animated: a soft light sweep on hover, only for summary / interactive cards
   (facility cards, stat cards, landing card). Form and table cards stay still so
   they never distract from data entry. */
.card, .form-card, .calendar-card, .stat-card, .room-card {
  box-shadow: 0 1px 2px rgba(16, 42, 86, .04), 0 4px 14px rgba(16, 42, 86, .05), inset 0 1px 0 rgba(255, 255, 255, .9);
}
.room-card, .stat-card, .landing-page .availability-card { position: relative; overflow: hidden; isolation: isolate; }
.room-card::after, .stat-card::after, .landing-page .availability-card::after {
  content: ""; position: absolute; z-index: 1; top: 0; bottom: 0; left: -60%; width: 45%;
  background: linear-gradient(105deg, transparent 0%, rgba(37, 99, 201, .07) 30%, rgba(244, 185, 66, .30) 50%, rgba(37, 99, 201, .07) 70%, transparent 100%);
  transform: skewX(-18deg); opacity: 0; pointer-events: none;
}
.room-card:hover::after, .stat-card:hover::after, .landing-page .availability-card:hover::after {
  opacity: 1; animation: card-shine .9s ease-out both;
}
.room-card:hover { box-shadow: 0 14px 32px rgba(16, 42, 86, .14), 0 0 0 1px rgba(37, 99, 201, .12), inset 0 1px 0 #fff; }
@keyframes card-shine { from { left: -60%; } to { left: 130%; } }
@media (prefers-reduced-motion: reduce) {
  .room-card:hover::after, .stat-card:hover::after, .landing-page .availability-card:hover::after { animation: none; opacity: 0; }
}

/* 24. Table toolbar, sorting & row actions --------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.card:has(> .table-toolbar) { padding: 0; overflow: hidden; }
.card:has(> .table-toolbar) > .table-wrap { border: 0; border-radius: 0; border-top: 1px solid var(--line); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; background: #fff; }
.table-search { position: relative; display: block; width: min(320px, 100%); margin: 0; }
.table-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.table-search input { min-height: 38px; padding: 8px 12px 8px 36px; font-size: var(--text-sm); background: var(--surface-2); border-radius: 999px; }
.table-search input:focus { background: #fff; }
.table-count { font-size: var(--text-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

.table-wrap th.sortable { cursor: pointer; user-select: none; transition: color .15s ease, background .15s ease; }
.table-wrap th.sortable::after { content: ""; display: inline-block; width: 8px; height: 10px; margin-left: 8px; vertical-align: -1px; opacity: .35;
  background: linear-gradient(currentColor, currentColor) center / 100% 0 no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M4 0l4 5H0zM4 12L0 7h8z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M4 0l4 5H0zM4 12L0 7h8z'/%3E%3C/svg%3E") center / contain no-repeat;
  background-color: currentColor; }
.table-wrap th.sortable:hover { color: var(--navy-800); background: #eaf1fb; }
.table-wrap th.sortable:hover::after { opacity: .7; }
.table-wrap th[aria-sort="ascending"], .table-wrap th[aria-sort="descending"] { color: var(--blue-700); }
.table-wrap th[aria-sort="ascending"]::after, .table-wrap th[aria-sort="descending"]::after { opacity: 1; }
.table-wrap th[aria-sort="ascending"]::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M4 3l4 5H0z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M4 3l4 5H0z'/%3E%3C/svg%3E"); }
.table-wrap th[aria-sort="descending"]::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M4 9L0 4h8z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M4 9L0 4h8z'/%3E%3C/svg%3E"); }
.table-wrap th.sortable:focus-visible { outline-offset: -3px; }
.no-results td { background: #fff !important; }

.ref-link { font-weight: 800; color: var(--navy-800); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.ref-link:hover { color: var(--blue-600); }
.table-wrap td.actions { white-space: nowrap; text-align: right; }
.row-action {
  display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 12px; margin-left: 6px;
  font: inherit; font-size: var(--text-xs); font-weight: 750; color: var(--blue-700);
  background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 6px; cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.row-action:hover { background: var(--blue-100); border-color: #b9d1f5; color: var(--blue-700); }
.row-action.danger { color: var(--danger-fg); background: #fff; border-color: #ecc3c3; }
.row-action.danger:hover { background: var(--danger-bg); border-color: #d99a9a; }
.table-wrap td small.reason { max-width: 240px; margin-top: 6px; padding: 6px 8px; font-size: 11px; line-height: 1.4; white-space: normal; color: var(--danger-fg); background: var(--danger-bg); border-left: 3px solid #c24141; border-radius: 4px; }
.table-wrap td:last-child a.row-action { padding: 0 12px; }

@media (max-width: 640px) {
  .table-toolbar { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 14px; }
  .table-search { width: 100%; }
}

/* 25. Animations ----------------------------------------------------------
   CSS-only (work without JS). All use `backwards` fill so they never leave a
   lingering transform that would fight hover effects. Disabled for users who
   prefer reduced motion (see the end of this section). */
@keyframes rise     { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade     { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes drop-in  { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes pop      { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(244, 185, 66, .55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(244, 185, 66, 0); } }
@keyframes donut-in { from { opacity: 0; transform: rotate(-90deg) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes check-draw { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
@keyframes ring-pop { 0% { transform: scale(.5); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

/* Page entrance */
.app-main > section { animation: fade .35s ease-out backwards; }
.page-heading { animation: rise .45s cubic-bezier(.2, .8, .2, 1) backwards; }
.flash { animation: drop-in .4s cubic-bezier(.2, .8, .2, 1) backwards; }
.sidebar nav a { animation: slide-in .4s ease-out backwards; }
.sidebar nav a:nth-child(2) { animation-delay: .03s; } .sidebar nav a:nth-child(3) { animation-delay: .06s; }
.sidebar nav a:nth-child(4) { animation-delay: .09s; } .sidebar nav a:nth-child(5) { animation-delay: .12s; }
.sidebar nav a:nth-child(6) { animation-delay: .15s; } .sidebar nav a:nth-child(7) { animation-delay: .18s; }
.sidebar nav a:nth-child(n+8) { animation-delay: .21s; }

/* Staggered cards, stats, facilities */
.app-main .card, .app-main .form-card, .app-main .calendar-card, .app-main .dashboard-hero { animation: rise .55s cubic-bezier(.2, .8, .2, 1) .08s backwards; }
.app-main .card:nth-of-type(2) { animation-delay: .16s; } .app-main .card:nth-of-type(3) { animation-delay: .24s; }
.stat-card:not([data-motion]) { animation: rise .5s cubic-bezier(.2, .8, .2, 1) backwards; }
.stats .stat-card:nth-child(1) { animation-delay: .06s; } .stats .stat-card:nth-child(2) { animation-delay: .12s; }
.stats .stat-card:nth-child(3) { animation-delay: .18s; } .stats .stat-card:nth-child(4) { animation-delay: .24s; }
.room-card { animation: rise .55s cubic-bezier(.2, .8, .2, 1) backwards; }
.room-grid .room-card:nth-child(1) { animation-delay: .05s; } .room-grid .room-card:nth-child(2) { animation-delay: .10s; }
.room-grid .room-card:nth-child(3) { animation-delay: .15s; } .room-grid .room-card:nth-child(4) { animation-delay: .20s; }
.room-grid .room-card:nth-child(5) { animation-delay: .25s; } .room-grid .room-card:nth-child(6) { animation-delay: .30s; }
.room-grid .room-card:nth-child(n+7) { animation-delay: .35s; }

/* Table rows cascade in */
.table-wrap tbody tr { animation: fade .45s ease-out backwards; }
.table-wrap tbody tr:nth-child(1) { animation-delay: .10s; } .table-wrap tbody tr:nth-child(2) { animation-delay: .14s; }
.table-wrap tbody tr:nth-child(3) { animation-delay: .18s; } .table-wrap tbody tr:nth-child(4) { animation-delay: .22s; }
.table-wrap tbody tr:nth-child(5) { animation-delay: .26s; } .table-wrap tbody tr:nth-child(6) { animation-delay: .30s; }
.table-wrap tbody tr:nth-child(7) { animation-delay: .34s; } .table-wrap tbody tr:nth-child(8) { animation-delay: .38s; }
.table-wrap tbody tr:nth-child(n+9) { animation-delay: .42s; }
.badge { transition: transform .15s ease; }
tr:hover .badge { transform: scale(1.06); }

/* Notifications: badge pops in, unread count gently pulses */
.nav-badge, .topbar-badge { animation: pop .45s cubic-bezier(.2, .8, .2, 1) .3s backwards, pulse-ring 2.4s ease-out 1s infinite; }
.notification-item.unread .notification-icon { animation: pulse-ring 2.4s ease-out infinite; }
.notification-item { animation: slide-in .4s ease-out backwards; }

/* Hover micro-interactions */
.sidebar nav a::before { transition: transform .2s ease, opacity .2s ease; }
.sidebar nav a:hover::before { transform: scale(1.12) translateX(1px); opacity: 1; }
.sidebar nav a:hover { transform: translateX(2px); }
.sidebar nav a { transition: background .15s ease, color .15s ease, transform .2s ease; }
.nav-button:hover::before { transform: translateX(3px); }
.calendar-event { transition: transform .15s ease, filter .15s ease; animation: fade .5s ease-out .2s backwards; }
a.calendar-event:hover { transform: translateY(-1px) scale(1.02); }
.calendar-cell { transition: background .15s ease; }
.row-action { transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.row-action:hover { transform: translateY(-1px); }
.filter-tabs a { transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }
.filter-tabs a:hover { transform: translateY(-1px); }
.step-number { transition: transform .2s ease; }
.section-title:hover .step-number { transform: scale(1.08); }
.avatar-large, .avatar-sm { transition: transform .2s ease; }
.avatar-large:hover, .avatar-sm:hover { transform: scale(1.06); }

/* Charts */
.donut { animation: donut-in .9s cubic-bezier(.2, .8, .2, 1) .15s backwards; }
.chart-legend li { animation: slide-in .45s ease-out backwards; }
.chart-legend li:nth-child(1) { animation-delay: .35s; } .chart-legend li:nth-child(2) { animation-delay: .43s; }
.chart-legend li:nth-child(3) { animation-delay: .51s; } .chart-legend li:nth-child(4) { animation-delay: .59s; }
.bar-list li:nth-child(2) .bar-fill { animation-delay: .08s; } .bar-list li:nth-child(3) .bar-fill { animation-delay: .16s; }
.bar-list li:nth-child(4) .bar-fill { animation-delay: .24s; } .bar-list li:nth-child(n+5) .bar-fill { animation-delay: .32s; }
.split-bar .seg-a { transform-origin: left; animation: bar-grow .8s cubic-bezier(.2, .8, .2, 1) .2s backwards; }

/* Success page */
.success-icon { animation: ring-pop .6s cubic-bezier(.2, .8, .2, 1) .1s backwards; }
.success-icon svg path { stroke-dasharray: 60; animation: check-draw .6s ease-out .45s backwards; }
.success-page > *:not(.success-icon) { animation: rise .5s ease-out .3s backwards; }

/* Auth & landing entrance */
.auth-card, .public-card, .error-page { animation: rise .6s cubic-bezier(.2, .8, .2, 1) backwards; }
.landing-nav { animation: drop-in .6s ease-out backwards; }
.hero-content > * { animation: rise .7s cubic-bezier(.2, .8, .2, 1) backwards; }
.hero-content > :nth-child(1) { animation-delay: .1s; } .hero-content > :nth-child(2) { animation-delay: .2s; }
.hero-content > :nth-child(3) { animation-delay: .3s; } .hero-content > :nth-child(4) { animation-delay: .4s; }
.hero-content > :nth-child(5) { animation-delay: .5s; }
.landing-page .availability-card { animation: rise .8s cubic-bezier(.2, .8, .2, 1) .35s backwards; }
.landing-room { animation: slide-in .5s ease-out backwards; }
.landing-room:nth-child(1) { animation-delay: .7s; } .landing-room:nth-child(2) { animation-delay: .78s; } .landing-room:nth-child(3) { animation-delay: .86s; }
.hero-primary:hover, .hero-secondary:hover { transform: translateY(-2px); }
.hero-primary { box-shadow: 0 6px 18px rgba(244, 185, 66, .35); }

/* Page-load progress bar on navigation */
.app-main::before { content: ""; position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px; background: linear-gradient(90deg, var(--blue-600), var(--gold-500)); transform-origin: left; animation: bar-grow .7s ease-out forwards, fade .4s ease-in .7s reverse forwards; pointer-events: none; }

/* Respect reduced motion: show everything immediately. */
@media (prefers-reduced-motion: reduce) {
  .app-main > section, .page-heading, .flash, .sidebar nav a, .app-main .card, .app-main .form-card, .app-main .calendar-card, .app-main .dashboard-hero,
  .stat-card, .room-card, .table-wrap tbody tr, .nav-badge, .topbar-badge, .notification-item, .notification-item.unread .notification-icon, .calendar-event,
  .donut, .chart-legend li, .split-bar .seg-a, .success-icon, .success-icon svg path, .success-page > *, .auth-card, .public-card, .error-page,
  .landing-nav, .hero-content > *, .landing-page .availability-card, .landing-room, .app-main::before { animation: none !important; }
  .app-main::before { display: none; }
}

/* 26. Gradients -----------------------------------------------------------
   One palette, used consistently: navy -> blue for primary surfaces and actions,
   gold for accents. Text on gradients keeps AA contrast. */
:root {
  --grad-primary: linear-gradient(135deg, #1b3d73 0%, #102a56 100%);
  --grad-primary-hover: linear-gradient(135deg, #2563c9 0%, #1b3d73 100%);
  --grad-brand: linear-gradient(135deg, #2563c9 0%, #102a56 100%);
  --grad-gold: linear-gradient(135deg, #ffd27a 0%, #f4b942 100%);
  --grad-canvas: radial-gradient(1100px 420px at 85% -80px, rgba(37, 99, 201, .10), transparent 70%),
                 radial-gradient(900px 380px at -10% 0, rgba(244, 185, 66, .09), transparent 70%),
                 linear-gradient(180deg, #f6f9fd 0%, #eef3f9 100%);
}

/* Canvas & shell */
body { background: var(--canvas); }
.app-main { background: var(--grad-canvas); background-attachment: fixed; }
.sidebar { background: linear-gradient(180deg, #0b1f3d 0%, #0c2a52 55%, #0a2347 100%); }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(37, 99, 201, .75), rgba(37, 99, 201, .35)); }
.sidebar .brand { border-image: linear-gradient(90deg, rgba(255,255,255,.22), rgba(255,255,255,0)) 1; }
.topbar { border-bottom: 0; box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(16, 42, 86, .04); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--blue-600), var(--gold-500) 60%, transparent); opacity: .85; }

/* Buttons */
.primary { background: var(--grad-primary); box-shadow: 0 2px 6px rgba(16, 42, 86, .25), inset 0 1px 0 rgba(255,255,255,.12); }
.primary:hover { background: var(--grad-primary-hover); box-shadow: 0 6px 16px rgba(37, 99, 201, .35); }
.danger { background: linear-gradient(135deg, #cf3a3a, #a31f1f); }
.danger:hover { background: linear-gradient(135deg, #b42323, #8a1818); }
.dashboard-hero .primary, .hero-primary { background: var(--grad-gold); color: var(--navy-900); }
.dashboard-hero .primary:hover, .hero-primary:hover { background: linear-gradient(135deg, #ffdf99, #f7c35c); }
.landing-login:hover { background: var(--grad-gold); }

/* Headings & numbers */
.page-heading h1, .brand-center h1, .success-page h1 {
  background: linear-gradient(100deg, #0b1f3d 0%, #1d4fa3 100%); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.stat-card strong, .donut-hole strong, .split-head strong {
  background: linear-gradient(135deg, #102a56, #2563c9); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.eyebrow { background: linear-gradient(90deg, #2563c9, #7b6cd9); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.dashboard-hero .eyebrow, .landing-eyebrow { background: none; -webkit-text-fill-color: currentColor; }
.dashboard-hero h1 { background: none; -webkit-text-fill-color: #fff; color: #fff; }

/* Surfaces */
.dashboard-hero {
  background:
    radial-gradient(520px 260px at 90% -10%, rgba(244, 185, 66, .32), transparent 70%),
    radial-gradient(420px 260px at 0% 120%, rgba(76, 141, 234, .45), transparent 70%),
    linear-gradient(120deg, #0b1f3d 0%, #1b3d73 60%, #2563c9 130%);
}
.dashboard-hero::after { display: none; }
.form-card, .calendar-card, .card.has-accent { position: relative; }
.form-card::before, .calendar-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--blue-600), var(--gold-500)); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.calendar-card { overflow: hidden; }
.stat-card::before { width: 5px; background: linear-gradient(180deg, #2563c9, #4c8dea); }
.stat-card:nth-child(2)::before { background: linear-gradient(180deg, #2f9e6b, #5cc596); }
.stat-card:nth-child(3)::before { background: linear-gradient(180deg, #f4b942, #ffd27a); }
.stat-card:nth-child(4)::before { background: linear-gradient(180deg, #7b6cd9, #a597f0); }
.stat-card { background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%); }
.room-card { background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%); }
.mini-stat, .split-block { background: transparent; }

/* Tables & badges */
.table-wrap th { background: linear-gradient(180deg, #fbfdff 0%, #eef3fa 100%); }
.badge.pending  { background: linear-gradient(180deg, #fff8e5, #ffeec2); }
.badge.approved, .badge.completed, .badge.booked { background: linear-gradient(180deg, #effaf4, #d9f1e4); }
.badge.rejected, .badge.cancelled, .badge.suspended, .badge.disabled { background: linear-gradient(180deg, #fff3f3, #fbdcdc); }
.badge.available, .badge.active, .badge.scheduled { background: linear-gradient(180deg, #f1f7ff, #dbe9fc); }
.filter-tabs a.active { background: var(--grad-primary); }
.row-action { background: linear-gradient(180deg, #f6faff, #e6f0ff); }
.step-number, .brand-mark, .avatar, .avatar-large, .avatar-sm { background: var(--grad-brand); }
.sidebar .brand-mark { background: linear-gradient(135deg, #4c8dea, #1b3d73); }
.nav-badge, .topbar-badge { background: var(--grad-gold); }

/* Charts */
.bar-fill { background: linear-gradient(90deg, #1d4fa3, #4c8dea 70%, #7fb0f5); }
.bar-list li:first-child .bar-fill { background: linear-gradient(90deg, #e0a62f, #f4b942 60%, #ffd27a); }
.split-bar .seg-a { background: linear-gradient(90deg, #1d4fa3, #4c8dea); }
.split-bar .seg-b { background: linear-gradient(90deg, #f4b942, #ffd27a); }
.donut { background: conic-gradient(from 0deg,
    #23855a 0, #3fb583 calc(var(--a-end) * 1%),
    #1d4fa3 calc(var(--a-end) * 1%), #4c8dea calc(var(--c-end) * 1%),
    #a82e2e calc(var(--c-end) * 1%), #d95a5a calc(var(--r-end) * 1%),
    #f1b84a calc(var(--r-end) * 1%), #ffd98a 100%); }
.calendar-event.pending { background: linear-gradient(90deg, #fff1cc, #fff8e4); }
.calendar-event.approved, .calendar-event.booked { background: linear-gradient(90deg, #dbe8fb, #eef4fe); }
.calendar-event.maintenance { background: linear-gradient(90deg, #ffe3d1, #fff0e6); }
.detail-reference, .reference-card { background: linear-gradient(135deg, #eef4fe, #f8fbff); }

/* Public pages */
.landing-hero .hero-overlay { background: linear-gradient(100deg, rgba(5, 24, 44, .94) 0%, rgba(8, 36, 72, .78) 50%, rgba(37, 99, 201, .35) 100%); }
.hero-content h1 em { background: linear-gradient(100deg, #ffd27a, #f4b942 55%, #ff9f5a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.public-main.auth-page { background: linear-gradient(100deg, rgba(5, 24, 44, .94) 0%, rgba(8, 36, 72, .78) 50%, rgba(37, 99, 201, .35) 100%), var(--navy-900) url("/images/cspc-campus-bg.png") center 46% / cover no-repeat fixed; }
.error-page h1 { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }

/* Fallbacks: if background-clip text isn't supported keep solid, readable text */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .page-heading h1, .brand-center h1, .success-page h1, .stat-card strong, .donut-hole strong, .split-head strong, .error-page h1 { color: var(--navy-800); -webkit-text-fill-color: currentColor; background: none; }
  .eyebrow { color: var(--blue-600); -webkit-text-fill-color: currentColor; background: none; }
}
@media (forced-colors: active) {
  .page-heading h1, .brand-center h1, .success-page h1, .stat-card strong, .donut-hole strong, .split-head strong, .eyebrow, .error-page h1 { background: none; -webkit-text-fill-color: currentColor; color: CanvasText; }
}

/* 27. Time selection: start / end drop-downs ------------------------------ */
.time-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.time-selects label { margin-top: 0; }
.booked-note { margin: 14px 0 0; padding: 10px 14px; font-size: var(--text-sm); color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.booked-note span { display: block; }
.booked-note span + span { margin-top: 4px; }
.booked-note .maint-line { color: var(--warn-fg); }
.booked-note .maint-line.hidden { display: none; }
.time-summary { margin-top: 12px; padding: 12px 16px; font-size: var(--text-md); font-weight: 600; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); font-variant-numeric: tabular-nums; }
.time-summary.is-set { font-weight: 800; color: var(--navy-800); background: var(--blue-50); border: 1px solid var(--blue-100); }
@media (max-width: 640px) { .time-selects { grid-template-columns: 1fr; } }

/* 29. Final polish ---------------------------------------------------------- */
/* Accessibility: skip link */
.skip-link { position: fixed; top: -48px; left: 12px; z-index: 100; padding: 10px 16px; font-weight: 700; font-size: var(--text-sm); color: #fff; background: var(--navy-800); border-radius: 8px; transition: top .15s ease; }
.skip-link:focus { top: 12px; color: #fff; }

/* Softer heading gradient so long titles don't split into two colours */
.page-heading h1, .brand-center h1, .success-page h1 { background: linear-gradient(100deg, #0b1f3d 0%, #173c78 100%); -webkit-background-clip: text; background-clip: text; }

/* Standalone cards must beat the generic `.app-main > section` max-width */
.app-main > .success-page { max-width: 560px; }
.app-main > .error-page { max-width: 480px; margin: 48px auto; }
.facility-type { width: fit-content; }

/* Maintenance list: roomy, stacked rows */
.admin-grid:has(.maintenance-list) { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.maintenance-item { flex-direction: column; align-items: stretch; gap: 10px; padding: 16px 0; }
.maintenance-item > div:first-child strong { font-size: var(--text-md); color: var(--navy-800); }
.maintenance-item > div:first-child span { margin-top: 2px; font-variant-numeric: tabular-nums; }
.maintenance-actions { flex-wrap: wrap; }

/* Notification icons: bell (unread) / check (read), drawn in CSS */
.notification-icon { position: relative; font-size: 0; }
.notification-icon::before { content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.7 21a2 2 0 0 1-3.4 0'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9'/%3E%3Cpath d='M13.7 21a2 2 0 0 1-3.4 0'/%3E%3C/svg%3E") center / contain no-repeat; }
.notification-item:not(.unread) .notification-icon::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }

/* Print: clean reservation pages */
@media print {
  .sidebar, .topbar, .skip-link, .heading-actions, .filter-tabs, .table-toolbar, .form-footer, .success-actions { display: none !important; }
  .app-main { margin: 0; padding: 0; background: #fff; }
  .card, .form-card, .success-page, .calendar-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  * { animation: none !important; }
}

/* Responsive fixes for the polish pass */
@media (max-width: 1100px) { .admin-grid:has(.maintenance-list) { grid-template-columns: 1fr; } }
.detail-header .badge, .review-header .badge, .reservation-title-row .badge { align-self: flex-start; width: fit-content; }

/* 30. Booking rules: chairs prompt, past states ----------------------------- */
.chairs-box { margin-top: 16px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.chairs-box .notice { margin: 0 0 4px; }
.chairs-box label { margin-top: 12px; }
.chairs-box.hidden { display: none; }
.notice.compact { margin: 16px 0 0; }
.locked-note { display: inline-flex; align-items: center; min-height: 32px; margin-left: 6px; padding: 0 12px; font-size: var(--text-xs); font-weight: 700; color: var(--muted); background: var(--neutral-bg); border: 1px dashed var(--neutral-bd); border-radius: 6px; cursor: help; }
.chairs-box .notice.compact { margin: 0 0 4px; }

/* Calendar facility filter */
.calendar-filter { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }
.calendar-filter label { margin: 0; font-weight: 600; }
.calendar-filter select { width: auto; min-width: 220px; max-width: 100%; }


/* Admin account management refresh */
.admin-account-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 20px; align-items: start; margin-bottom: 22px; }
.admin-create-card, .admin-security-card, .admin-list-card { border-color: #dce5f1; }
.admin-card-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.admin-card-heading h2, .admin-security-card h2 { margin: 0 0 5px; font-size: 20px; }
.admin-card-heading p, .admin-security-card > p, .admin-list-card .card-heading p { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.admin-card-icon { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 13px; color: #fff; font-size: 28px; font-weight: 500; background: var(--grad-primary); box-shadow: 0 7px 16px rgba(37,99,201,.2); }
.admin-account-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.admin-account-form label { display: block; color: var(--ink); font-size: var(--text-sm); font-weight: 700; }
.admin-account-form input { margin-top: 7px; }
.admin-account-form .field-hint { font-weight: 400; line-height: 1.45; }
.admin-create-button { grid-column: 1 / -1; min-height: 48px; background: var(--grad-primary); box-shadow: 0 6px 16px rgba(16,42,86,.15); }
.admin-create-button:hover { filter: brightness(1.06); }
.admin-security-card { background: linear-gradient(145deg, #fff 0%, #f4f8ff 100%); }
.admin-security-card .eyebrow { margin-bottom: 10px; }
.admin-security-card ul { list-style: none; padding: 0; margin: 20px 0 0; }
.admin-security-card li { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.admin-security-card li strong { font-size: var(--text-sm); color: var(--navy-800); }
.admin-security-card li span { color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }
.admin-self-label { color: var(--blue-600) !important; font-weight: 700; }
.admin-request-actions { min-width: 125px; }
.admin-request-actions small { display: block; max-width: 130px; margin-top: 5px; color: var(--muted); font-size: 11px; }
@media (max-width: 850px) { .admin-account-layout { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .admin-account-form { grid-template-columns: 1fr; } .admin-create-button { grid-column: auto; } }

/* 31. Global layout and overlap-prevention pass (2026-10-21) */
:root { --page-pad: clamp(16px, 2.2vw, 32px); }
html { overflow-x: clip; }
body { min-width: 320px; overflow-x: clip; }
main, section, article, aside, header, footer, form, fieldset, .card, .form-card,
.room-card, .stat-card, .page-heading, .card-heading, .admin-grid > *,
.admin-detail-grid > *, .profile-grid > *, .security-grid > *, .admin-account-layout > * {
  min-width: 0;
}
.app-main > section { width: 100%; }
.page-heading > div, .card-heading > div, .topbar-user, .topbar-user .who,
.admin-card-heading > div:last-child, .notification-content, .maintenance-item > div:first-child {
  min-width: 0;
}
.page-heading p, .card-heading p, .admin-card-heading p, .notice, .field-hint,
.notification-content p, .maintenance-item span, td, th, .who strong {
  overflow-wrap: anywhere;
  word-break: normal;
}
.page-heading { flex-wrap: wrap; }
.page-heading .heading-actions, .page-heading > .badge { flex: 0 0 auto; }
.heading-actions { max-width: 100%; }
.topbar { min-width: 0; }
.topbar > span { min-width: 0; overflow-wrap: anywhere; }
.topbar-user { flex-wrap: wrap; justify-content: flex-end; }
.topbar-user .who { max-width: min(36vw, 280px); }
.topbar-user .who strong, .topbar-user .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-link { white-space: nowrap; }

/* Prevent grid children and long labels from forcing horizontal overflow. */
.stats, .admin-grid, .admin-detail-grid, .detail-grid, .profile-grid, .security-grid,
.admin-account-layout, .room-grid, .two-col, .review-grid, .detail-fields,
.time-selects, .report-grid, .admin-account-form { min-width: 0; }
.room-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.admin-account-layout { grid-template-columns: minmax(0, 1.65fr) minmax(250px, 1fr); }
.admin-account-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-account-form label { min-width: 0; line-height: 1.45; }
.admin-account-form input, .admin-account-form select, .admin-account-form textarea { min-width: 0; }
.admin-account-form .field-hint { overflow-wrap: anywhere; }
.admin-create-button { white-space: normal; line-height: 1.3; padding: 12px 16px; }

/* Buttons and inline actions may wrap instead of colliding with adjacent content. */
button, .primary, .secondary, .danger, .danger-outline, .button-link, .button-link-dark {
  max-width: 100%;
}
.heading-actions, .maintenance-actions, .form-footer, .success-actions,
.request-actions, .admin-request-actions, .reservation-actions {
  flex-wrap: wrap;
  min-width: 0;
}
.inline-form { max-width: 100%; }
.table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
.table-wrap table { width: 100%; }
.table-wrap td form { max-width: 100%; }
.table-wrap td .primary, .table-wrap td .secondary, .table-wrap td .danger,
.table-wrap td .danger-outline { white-space: normal; line-height: 1.25; padding: 8px 10px; }

/* Form rhythm: consistent spacing and readable validation hints. */
label { line-height: 1.4; }
label > input, label > select, label > textarea { display: block; }
form > label + label { margin-top: 16px; }
.form-card .two-col > label, .admin-account-form > label { margin-top: 0; }
input, select, textarea { max-width: 100%; }
textarea { line-height: 1.55; }
.form-footer { align-items: center; }

/* Calendar: keep event text inside each day cell. */
.calendar-card, .calendar-grid, .calendar-weekdays, .calendar-cell { min-width: 0; }
.calendar-cell { overflow: hidden; }
.calendar-events { min-width: 0; }
.calendar-event { min-width: 0; overflow-wrap: anywhere; }
.calendar-event strong, .calendar-event span { max-width: 100%; }

/* Medium screens */
@media (max-width: 1100px) {
  .admin-account-layout { grid-template-columns: minmax(0, 1fr); }
  .topbar-user .who { max-width: 220px; }
}
@media (max-width: 900px) {
  .sidebar { min-width: 0; }
  .sidebar .brand { min-width: 0; }
  .sidebar nav { min-width: 0; max-width: 100%; padding-bottom: 3px; }
  .sidebar nav a { flex: 0 0 auto; }
  .logout-form { align-self: flex-start; max-width: 100%; }
  .topbar { align-items: flex-start; }
  .topbar-user { gap: 8px; }
  .app-main > section { max-width: none; }
}
@media (max-width: 640px) {
  :root { --page-pad: 14px; }
  .topbar { align-items: flex-start; gap: 10px; }
  .topbar > span { flex: 1 1 100%; }
  .topbar-user { width: 100%; justify-content: flex-start; }
  .topbar-user .who { max-width: calc(100vw - 120px); }
  .notification-link { margin-right: 0; }
  .avatar-sm { flex: 0 0 auto; }
  .page-heading { gap: 12px; margin-bottom: 18px; }
  .page-heading .heading-actions { width: 100%; }
  .page-heading .heading-actions > a, .page-heading .heading-actions > button { flex: 1 1 100%; }
  .admin-account-form { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .admin-create-button { grid-column: auto; }
  .admin-card-heading { align-items: flex-start; }
  .admin-card-icon { width: 40px; height: 40px; }
  .admin-list-card .card-heading { gap: 8px; }
  .notification-item { padding: 14px 16px; gap: 10px; }
  .notification-title-row { align-items: flex-start; flex-wrap: wrap; }
  .maintenance-item { align-items: stretch; }
  .maintenance-actions > * { flex: 1 1 auto; }
  .form-footer { align-items: stretch; }
  .form-footer > * { max-width: 100%; }
  .calendar-grid { overflow-x: auto; }
  .calendar-grid, .calendar-weekdays { min-width: 520px; }
  .table-wrap table { min-width: 620px; }
  .admin-grid .table-wrap table { min-width: 560px; }
  .auth-card, .public-card { max-width: 100%; }
}
@media (max-width: 380px) {
  .brand-mark { width: 38px; height: 38px; }
  .sidebar .brand strong { font-size: 15px; }
  .sidebar .brand small { font-size: 10px; }
  .card, .form-card { padding: 15px; }
  .stat-card { padding: 16px; }
  .stat-card strong { font-size: 27px; }
  .topbar-user { align-items: flex-start; }
}


/* 32. Final alignment refinement (2026-10-21) */
.app-main {
  padding-top: calc(var(--topbar-h) + 28px);
}
.app-main > .admin-accounts-page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}
.admin-accounts-page .page-heading {
  align-items: center;
  margin-bottom: 22px;
}
.admin-accounts-page .page-heading h1 {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.2;
}
.admin-accounts-page .admin-account-layout {
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, .95fr);
  align-items: stretch;
  gap: 20px;
  margin-bottom: 22px;
}
.admin-accounts-page .admin-create-card,
.admin-accounts-page .admin-security-card,
.admin-accounts-page .admin-list-card {
  margin: 0;
  padding: 24px;
  min-width: 0;
}
.admin-accounts-page .admin-security-card {
  align-self: stretch;
}
.admin-accounts-page .admin-card-heading {
  align-items: flex-start;
  min-width: 0;
}
.admin-accounts-page .admin-card-heading h2,
.admin-accounts-page .admin-security-card h2 {
  font-size: 18px;
  line-height: 1.3;
}
.admin-accounts-page .admin-account-form {
  gap: 14px 16px;
  margin-top: 18px;
}
.admin-accounts-page .admin-account-form label {
  margin: 0;
}
.admin-accounts-page .admin-account-form input {
  min-height: 44px;
}
.admin-accounts-page .admin-create-button {
  min-height: 46px;
  margin-top: 2px;
}
.admin-accounts-page .admin-list-card .card-heading {
  margin-bottom: 16px;
}
.admin-accounts-page .table-wrap {
  border-radius: 10px;
}
.admin-accounts-page .table-wrap table {
  min-width: 660px;
  table-layout: auto;
}
.admin-accounts-page .table-wrap th,
.admin-accounts-page .table-wrap td {
  padding: 13px 16px;
}
.admin-accounts-page .table-wrap td strong {
  white-space: normal;
  overflow-wrap: anywhere;
}
.admin-accounts-page .table-wrap td:nth-child(2),
.admin-accounts-page .table-wrap td:nth-child(4),
.admin-accounts-page .table-wrap td:nth-child(5) {
  white-space: nowrap;
}
.admin-accounts-page .admin-self-label {
  display: block;
}
@media (max-width: 1100px) {
  .admin-accounts-page .admin-account-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-accounts-page .admin-security-card {
    align-self: auto;
  }
}
@media (max-width: 640px) {
  .app-main {
    padding-top: calc(var(--topbar-h) + 20px);
  }
  .admin-accounts-page .page-heading {
    align-items: flex-start;
  }
  .admin-accounts-page .admin-create-card,
  .admin-accounts-page .admin-security-card,
  .admin-accounts-page .admin-list-card {
    padding: 18px;
  }
  .admin-accounts-page .admin-account-layout {
    gap: 14px;
    margin-bottom: 16px;
  }
}


/* Reservation slip: hide screen-only controls when printing */
.print-only { display: none; }
@media print {
  .print-only { display: block; margin: 0 0 12px; font-size: 12px; color: #444; }
  .detail-side, .detail-grid form { display: none !important; }
}


/* Reports: CSV export form */
.export-form { margin: 0 0 20px; }
.export-fields { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.export-fields > div { display: flex; flex-direction: column; gap: 6px; min-width: 150px; flex: 1 1 150px; }
.export-fields label { margin: 0; font-weight: 600; }
.export-fields .export-action { flex: 0 0 auto; min-width: 0; }


/* QR check-in */
.scan-card { max-width: 520px; text-align: center; margin: 0 auto; }
.scan-button { font-size: 1.25rem; padding: 18px; margin-top: 12px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.qr-card { text-align: center; }
.qr-image svg { width: 100%; max-width: 240px; height: auto; }
.qr-place { color: #6b7a90; margin: 0 0 8px; }
.qr-howto { line-height: 1.5; margin: 8px 0 0; }
.qr-url { word-break: break-all; color: #6b7a90; }
@media print {
  .no-print { display: none !important; }
  .qr-grid { display: block; }
  .qr-card { page-break-after: always; break-after: page; border: 2px solid #000; box-shadow: none; margin: 0 auto; max-width: 420px; padding: 24px; }
  .qr-card:last-child { page-break-after: auto; break-after: auto; }
  .qr-image svg { max-width: 320px; }
}


/* 33. UX & spacing pass (multi-college release) ----------------------------
   Appended last on purpose so it wins the cascade; each block says what it fixes. */

/* Selects: one consistent control. The native arrow sat flush against the edge and the
   text indent differed from inputs. */
select {
  -webkit-appearance: none; appearance: none;
  padding-right: 38px; text-overflow: ellipsis;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
select:disabled { background-color: var(--surface-2); }
.table-wrap select { padding-right: 30px; background-position: right 9px center; background-size: 14px; }

/* Forms: the hidden CSRF input is the first child, so ":first-child" never matched and the
   first step kept a stray divider plus a gap above it. */
.form-card .section-title:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.app-main > section + section { margin-top: 36px; }
.card > .empty { padding: 28px 20px; }

/* Table row actions: buttons, selects and forms were touching and at different heights. */
.table-wrap td:last-child { white-space: normal; }
.table-wrap td:last-child > a, .table-wrap td:last-child > form, .table-wrap td:last-child > .inline-form {
  margin: 0 8px 6px 0; vertical-align: middle;
}
.table-wrap td:last-child > a:last-child, .table-wrap td:last-child > form:last-child { margin-right: 0; }
.table-wrap td:last-child a, .table-wrap td:last-child button, .table-wrap td:last-child select {
  min-height: 34px; font-size: var(--text-sm);
}
.table-wrap td:last-child a, .table-wrap td:last-child button {
  display: inline-flex; align-items: center; justify-content: center; padding: 0 12px;
}

/* Sidebar: "Admin Accounts" had no icon rule and rendered as a solid square. */
.sidebar nav a[href="/admin/admin-accounts"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='4.5'/%3E%3Cpath d='M10.7 12.3L21 2M16 7l3 3M14 9l2 2'/%3E%3C/svg%3E"); }

/* Account pages */
.profile-meta .meta-wide { grid-column: 1 / -1; }

/* Register: wider card so paired fields have room; calmer vertical rhythm */
.register-card { width: min(640px, 100%); }
.register-form .two-col { gap: 0 16px; }
.register-form .field-hint { margin: 8px 0 0; }
.register-form .primary.full { margin-top: 4px; }
.auth-card > .muted.center { margin: 20px 0 0; }

/* Small screens: the nav strip, log out and top bar used to stack into three cramped
   rows with a dead gap between them. Now: brand + log out on one row, a scrollable nav
   strip (fade shows there is more), and a single-row top bar. */
@media (max-width: 900px) {
  .app-main { padding-top: 0; }
  .sidebar {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand logout" "nav nav";
    align-items: center; column-gap: 8px; padding: 12px 14px 10px;
  }
  .sidebar .brand { grid-area: brand; margin: 0; padding: 2px 4px; border-bottom: 0; }
  .sidebar .logout-form { grid-area: logout; margin: 0; padding: 0; border-top: 0; align-self: center; }
  .sidebar .logout-form .nav-button { width: auto; margin: 0; }
  .sidebar nav {
    grid-area: nav; margin-top: 10px; padding: 0 28px 4px 0; scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  }
  .sidebar nav a { scroll-snap-align: center; }
  .topbar { margin: 0 calc(-1 * var(--page-pad)) 18px; min-height: 56px; padding: 10px var(--page-pad); flex-wrap: nowrap; align-items: center; }
  .topbar > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .notification-link { display: none; }
  .topbar-user { width: auto; flex-wrap: nowrap; justify-content: flex-end; }
  .topbar-user .who { max-width: 44vw; }
}

/* Small screens: tables scroll sideways, so keep each row's actions on one line
   instead of stacking them into 140px-tall rows. */
@media (max-width: 900px) {
  .table-wrap td:last-child { white-space: nowrap; }
}


/* 2026-11-24 UX refinement: consistent spacing and facility directory */
:root { --page-pad: 36px; --space-section: 26px; }
.app-main { min-width: 0; }
.app-main > section { width: 100%; max-width: 1480px; margin-inline: auto; }
.page-heading { gap: 22px; margin-bottom: 26px; align-items: flex-end; }
.page-heading p { max-width: 720px; margin-top: 8px; line-height: 1.65; }
.card, .form-card, .calendar-card { padding: 24px; border-radius: 14px; }
.room-grid { gap: 20px; }
.room-card { min-width: 0; padding: 22px; border-radius: 14px; }
.room-card h2 { margin: 12px 0 8px; line-height: 1.35; }
.room-card p { line-height: 1.65; }
.section-title { margin-top: 28px; margin-bottom: 14px; gap: 12px; }
label { margin-top: 18px; }
.form-footer { margin-top: 26px; padding-top: 20px; gap: 16px; }
.facilities-heading { align-items: center; }
.facilities-count { display:flex; flex-direction:column; align-items:flex-end; flex:none; color:var(--muted); font-size:12px; }
.facilities-count strong { color:var(--navy-800); font-size:26px; line-height:1.1; }
.facility-toolbar { display:grid; grid-template-columns:minmax(220px,1fr) minmax(220px,.55fr) auto; align-items:end; gap:10px 16px; margin-bottom:22px; padding:18px 20px; }
.facility-toolbar label { margin:0 0 6px; }
.facility-search-label { grid-column:1; grid-row:1; }
.facility-filter-label { grid-column:2; grid-row:1; }
#facilitySearch { grid-column:1; grid-row:2; }
#collegeFilter { grid-column:2; grid-row:2; }
.facility-results { grid-column:3; grid-row:2; color:var(--muted); font-size:12px; white-space:nowrap; padding:11px 0; }
.facilities-grid { align-items:stretch; }
.facility-card { display:flex; flex-direction:column; gap:0; }
.facility-card-top { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.facility-college { display:flex; flex-direction:column; gap:3px; margin-top:18px; color:var(--muted); font-size:12px; line-height:1.4; }
.facility-college span { color:var(--blue-700); font-size:11px; font-weight:800; letter-spacing:.08em; }
.facility-card h2 { margin-top:10px; }
.facility-card > p { flex:1; }
.facility-card .room-meta { display:flex; flex-wrap:wrap; gap:8px 14px; margin-top:16px; padding-top:14px; border-top:1px solid var(--line-soft); }
.facility-card .room-meta span { font-size:12px; }
.facility-location { margin-top:12px; color:var(--muted); font-size:12px; }
.empty-state { text-align:center; padding:42px 24px; margin-top:18px; }
.empty-state h2 { margin-bottom:8px; }
.empty-state p { margin:0; color:var(--muted); }
@media (max-width:900px) {
  :root { --page-pad: 22px; }
  .facility-toolbar { grid-template-columns:1fr 1fr; }
  .facility-search-label { grid-column:1; grid-row:1; }
  .facility-filter-label { grid-column:2; grid-row:1; }
  #facilitySearch { grid-column:1; grid-row:2; }
  #collegeFilter { grid-column:2; grid-row:2; }
  .facility-results { grid-column:1 / -1; grid-row:3; padding:0; }
}
@media (max-width:560px) {
  :root { --page-pad: 16px; }
  .page-heading { align-items:flex-start; margin-bottom:20px; }
  .facilities-count { align-items:flex-start; }
  .facility-toolbar { grid-template-columns:1fr; gap:8px; padding:16px; }
  .facility-search-label, #facilitySearch, .facility-filter-label, #collegeFilter, .facility-results { grid-column:1; }
  .facility-search-label { grid-row:1; } #facilitySearch { grid-row:2; }
  .facility-filter-label { grid-row:3; margin-top:6px; } #collegeFilter { grid-row:4; }
  .facility-results { grid-row:5; padding-top:4px; }
  .card, .form-card, .calendar-card { padding:18px; }
  .room-card { padding:18px; }
}


/* 2026-11-24: restrained typography, spacing and directory controls */
:root {
  --font: "Inter", sans-serif;
  --page-pad: 32px;
}
body { font-family: "Inter", sans-serif; }
h1, h2, h3, h4, .sidebar .brand strong { font-family: "Source Sans 3", sans-serif; letter-spacing: 0; }
h1 { font-size: 28px; font-weight: 700; }
.page-heading { margin-bottom: 20px; gap: 16px; }
.page-heading p { margin-top: 4px; line-height: 1.5; }
.eyebrow { background: none; color: var(--muted); -webkit-text-fill-color: currentColor; letter-spacing: .07em; }
.page-heading h1, .brand-center h1, .success-page h1 { background: none; color: var(--navy-900); -webkit-text-fill-color: currentColor; }
.card, .form-card, .calendar-card, .room-card, .stat-card { box-shadow: 0 1px 3px rgba(15, 35, 65, .06); }
.room-card { background: #fff; }
.form-card::before, .calendar-card::before { display: none; }
.sidebar { background: var(--navy-900); }
.sidebar nav a.active { background: #1b3d73; }
.topbar::after, .app-main::before { display: none; }
.step-number, .sidebar .brand-mark, .brand-center .brand-mark { background: var(--navy-800); box-shadow: none; }
.section-title:hover .step-number { transform: none; }
.dashboard-hero::after { display: none; }
.app-main .card, .app-main .form-card, .app-main .calendar-card, .app-main .dashboard-hero,
.page-heading, .room-grid .room-card { animation: none; }
.facility-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(210px, 1fr) minmax(190px, .85fr);
  gap: 14px;
  align-items: end;
  padding: 16px;
  margin-bottom: 18px;
}
.facility-control { min-width: 0; }
.facility-control label { margin: 0 0 6px; }
.facility-results { grid-column: 1 / -1; margin: 0; padding: 0; color: var(--muted); font-size: 12px; }
.facility-card { padding: 20px; border-radius: 10px; }
.facility-college { margin-top: 14px; gap: 2px; }
.facility-college strong { color: var(--blue-700); font-size: 12px; }
.facility-college span { color: var(--muted); font-weight: 400; letter-spacing: 0; }
.facility-card h2 { margin-top: 8px; }
.facility-card .room-meta { gap: 6px 12px; }
.facility-pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 18px 0 28px; color: var(--muted); font-size: 13px; }
.facility-page-actions { display: flex; gap: 8px; }
.facility-page-actions button { min-height: 38px; }
.reservation-page > .page-heading { margin-bottom: 18px; }
.reservation-page .section-title { margin-top: 24px; padding-top: 20px; }
.reservation-page .section-title:first-child { margin-top: 0; }
.reservation-page .section-title small { display: none; }
@media (max-width: 900px) {
  .facility-toolbar { grid-template-columns: 1fr 1fr; }
  .facility-search-control { grid-column: 1 / -1; }
  .facility-results { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  :root { --page-pad: 16px; }
  .facility-toolbar { grid-template-columns: 1fr; gap: 10px; }
  .facility-search-control, .facility-results { grid-column: 1; }
  .facility-pagination { align-items: flex-start; flex-direction: column; }
  .facility-page-actions { width: 100%; }
  .facility-page-actions button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Flat surfaces and restrained status colours across the application. */
.dashboard-hero { background: var(--navy-800); }
.table-wrap th { background: #f5f7fa; }
.badge.pending { background: var(--pending-bg); }
.badge.approved, .badge.completed, .badge.booked { background: var(--success-bg); }
.badge.rejected, .badge.cancelled, .badge.suspended, .badge.disabled { background: var(--danger-bg); }
.badge.available, .badge.active, .badge.scheduled { background: var(--info-bg); }
.badge.maintenance { background: var(--warn-bg); }
.bar-fill { background: var(--blue-600); }
.bar-list li:first-child .bar-fill { background: var(--gold-500); }
.calendar-event.pending { background: var(--pending-bg); }
.calendar-event.approved, .calendar-event.booked { background: var(--blue-100); }
.calendar-event.maintenance { background: var(--warn-bg); }

/* Calendar refinement: clear month controls, aligned grid and restrained states. */
.calendar-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce4ee;
  border-radius: 12px;
}
.calendar-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 82px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.calendar-toolbar > div { text-align: center; }
.calendar-month-heading h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}
.calendar-nav {
  width: 38px;
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: var(--navy-800);
  background: #fff;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}
.calendar-nav-next { justify-self: end; }
.calendar-nav:hover, .calendar-nav:focus-visible {
  color: var(--navy-900);
  background: #f3f6fa;
  border-color: #94a3b8;
}
.calendar-nav:focus-visible, .today-link:focus-visible,
.calendar-scroll:focus-visible, .calendar-filter select:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
}
.today-link {
  display: inline-block;
  margin-top: 4px;
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.today-link:hover { text-decoration: underline; }
.calendar-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  margin: 0;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line-soft);
}
.calendar-filter label {
  flex: 0 0 auto;
  margin: 0;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}
.calendar-filter select {
  width: min(320px, 100%);
  min-height: 42px;
  margin: 0;
  padding: 8px 36px 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #334155;
  background-color: #fff;
  font: inherit;
  font-size: 13px;
}
.calendar-scroll { width: 100%; overflow-x: auto; }
.calendar-weekdays, .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
}
.calendar-weekdays {
  background: #f5f7fa;
  border-bottom: 1px solid #dce4ee;
}
.calendar-weekdays > div {
  padding: 11px 6px;
  color: #52627a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .035em;
  text-align: center;
  text-transform: uppercase;
}
.calendar-cell {
  min-width: 0;
  min-height: 126px;
  padding: 8px;
  overflow: hidden;
  background: #fff;
  border-right: 1px solid #e7edf4;
  border-bottom: 1px solid #e7edf4;
}
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-cell:nth-child(7n), .calendar-cell:nth-child(7n-1) { background-color: #fbfcfe; }
.calendar-cell.blank { background: #f6f8fb; }
.calendar-cell.today {
  position: relative;
  background: #f4f8ff;
  box-shadow: inset 0 0 0 2px #6b94d2;
}
.day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  margin: 0 0 7px;
  padding: 0 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}
.calendar-cell.today .day-number {
  color: #fff;
  background: var(--blue-700);
  border-radius: 50%;
}
.calendar-events {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 92px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.calendar-event {
  display: block;
  min-width: 0;
  padding: 5px 7px;
  overflow: hidden;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #94a3b8;
  border-radius: 5px;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.calendar-event strong { display: block; font-size: 10px; font-weight: 700; }
.calendar-event span { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event small { display: block; margin-top: 1px; font-size: 10px; opacity: .85; }
.calendar-event.pending { color: #79520b; background: #fff8e7; border-color: #e7c779; border-left-color: #c58a19; }
.calendar-event.approved, .calendar-event.booked { color: #234b82; background: #eff5fd; border-color: #cbdcf2; border-left-color: #4778b9; }
.calendar-event.maintenance { color: #85451f; background: #fff5ed; border-color: #f0d2bd; border-left-color: #c8753d; }
a.calendar-event:hover { filter: brightness(.98); text-decoration: none; }
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 14px 24px;
  color: #64748b;
  background: #fff;
  border-top: 1px solid #e7edf4;
  font-size: 12px;
}
.calendar-legend span { display: inline-flex; align-items: center; gap: 7px; }
.status-dot { width: 9px; height: 9px; }
.pending-dot { background: #c58a19; }
.approved-dot { background: #4778b9; }
.maintenance-dot { background: #c8753d; }
@media (max-width: 760px) {
  .calendar-scroll { overscroll-behavior-x: contain; }
  .calendar-weekdays, .calendar-grid { min-width: 700px; }
  .calendar-cell { min-height: 112px; }
}
@media (max-width: 560px) {
  .calendar-toolbar { min-height: 72px; padding: 12px 14px; }
  .calendar-month-heading h2 { font-size: 17px; }
  .calendar-nav { width: 34px; height: 34px; }
  .calendar-filter { align-items: flex-start; flex-direction: column; gap: 6px; padding: 12px 14px; }
  .calendar-filter select { width: 100%; }
  .calendar-legend { gap: 12px; padding: 12px 14px; }
}


/* Campus-wide landing page responsive refinements */
@media (max-width: 1100px) {
  .landing-hero { gap: 30px; padding-left: 5vw; padding-right: 5vw; }
  .hero-content { width: 55%; }
  .availability-card { width: 42%; padding: 22px; }
  .landing-how { padding-left: 5vw; padding-right: 5vw; gap: 36px; }
}
@media (max-width: 760px) {
  .landing-nav { min-height: 70px; padding: 10px 20px; }
  .landing-nav-actions { gap: 12px; }
  .landing-nav-link { display: none; }
  .landing-brand strong { font-size: 15px; }
  .landing-brand small { max-width: 210px; font-size: 9px; }
  .brand-mark { width: 38px; height: 38px; }
  .landing-hero { min-height: auto; padding: 118px 22px 72px; flex-direction: column; align-items: stretch; gap: 34px; }
  .hero-overlay { background: linear-gradient(180deg, rgba(5,20,40,.91), rgba(5,20,40,.78)); }
  .hero-content { width: 100%; }
  .hero-content h1 { font-size: clamp(42px, 11vw, 62px); }
  .hero-content > p { font-size: 15px; }
  .hero-actions { align-items: stretch; }
  .hero-primary, .hero-secondary { min-height: 48px; }
  .availability-card { width: 100%; padding: 22px; }
  .landing-bottom-note { left: 22px; bottom: 20px; font-size: 9px; }
  .landing-how { display: block; padding: 62px 22px; }
  .landing-section-intro { margin-bottom: 28px; }
  .landing-steps { grid-template-columns: 1fr; gap: 12px; }
  .landing-step { min-height: 0; display: flex; gap: 18px; padding: 17px; }
  .step-number { margin: 2px 0 0; }
  .landing-footer { padding: 20px 22px; flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 420px) {
  .landing-brand { gap: 8px; }
  .landing-brand small { max-width: 175px; }
  .landing-login { min-height: 38px; padding: 0 13px; }
  .hero-actions { flex-direction: column; }
  .hero-primary, .hero-secondary { width: 100%; }
}

/* Landing page must scroll to the workflow section and footer */
.public-main.landing-main { height: auto; min-height: 100vh; overflow: visible; }


/* System Administrator dashboard: icon, page heading and college table */
.sidebar nav a[href="/system-admin"] {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.8 19 5.5v5.7c0 4.5-2.8 8-7 10-4.2-2-7-5.5-7-10V5.5l7-2.7Z'/%3E%3Cpath d='M9.2 12.1a2.8 2.8 0 1 1 5.6 0 2.8 2.8 0 0 1-5.6 0Z'/%3E%3Cpath d='M7.7 17c.8-1.5 2.3-2.3 4.3-2.3s3.5.8 4.3 2.3'/%3E%3C/svg%3E");
}

.system-admin-page {
  width: 100%;
  max-width: 1480px;
  min-width: 0;
  margin: 0 auto;
  padding-top: 18px;
}
.system-admin-page > .page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 24px;
  padding: 0;
}
.system-admin-page > .page-header h1 {
  margin: 0;
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1.2;
  color: var(--navy-900);
  -webkit-text-fill-color: currentColor;
}
.system-admin-page > .page-header .eyebrow {
  margin: 0 0 7px;
}
.system-admin-page > .page-header p.muted {
  margin: 8px 0 0;
  max-width: 760px;
  line-height: 1.55;
}
.system-admin-page > .card {
  width: 100%;
  min-width: 0;
  margin-bottom: 20px !important;
  padding: 24px;
}
.system-admin-page .card-body {
  min-width: 0;
  padding: 0;
}
.system-admin-page .card-body > h2 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.35;
}
.system-admin-page .card-body > p.muted {
  margin: 0 0 16px;
  max-width: 100%;
  line-height: 1.55;
}
.system-admin-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.system-admin-page table.system-admin-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.system-admin-page .system-admin-table th {
  padding: 13px 16px;
  text-align: left;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: #52627a;
  background: #f3f6fb;
  border-bottom: 1px solid var(--line);
}
.system-admin-page .system-admin-table th:nth-child(1) { width: 29%; }
.system-admin-page .system-admin-table th:nth-child(2) { width: 39%; }
.system-admin-page .system-admin-table th:nth-child(3) { width: 15%; }
.system-admin-page .system-admin-table th:nth-child(4) { width: 17%; }
.system-admin-page .system-admin-table td {
  padding: 15px 16px;
  vertical-align: middle;
  text-align: left;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft);
  overflow-wrap: anywhere;
}
.system-admin-page .system-admin-table tbody tr:last-child td { border-bottom: 0; }
.system-admin-page .system-admin-table tbody tr:hover td { background: #f8fbff; }
.system-admin-page .system-admin-table td strong {
  display: inline-block;
  color: var(--navy-800);
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
}
.system-admin-page .system-admin-table td small {
  display: inline-block;
  margin-top: 3px;
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.system-admin-page .system-admin-table td:nth-child(3) { white-space: nowrap; }
.system-admin-page .system-admin-table td:nth-child(4) { white-space: nowrap; }
.system-admin-page .system-admin-table td details { position: relative; }
.system-admin-page .system-admin-table td summary.button-link-dark {
  display: inline-flex;
  min-width: 88px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid var(--blue-100);
  border-radius: 8px;
  background: #fff;
  color: var(--navy-800);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.system-admin-page .system-admin-table td summary.button-link-dark::-webkit-details-marker { display: none; }
.system-admin-page .system-admin-table td summary.button-link-dark:hover { background: var(--blue-50); }
.system-admin-page .system-admin-table td details[open] > form {
  position: relative;
  z-index: 2;
  width: min(300px, 78vw);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16,42,86,.14);
}
.system-admin-page .system-admin-table td details[open] > form + form {
  width: auto;
  padding: 0;
  border: 0;
  box-shadow: none;
}
@media (max-width: 760px) {
  .system-admin-page { padding-top: 10px; }
  .system-admin-page > .page-header { margin-bottom: 18px; }
  .system-admin-page > .card { padding: 18px; }
  .system-admin-page .system-admin-table { min-width: 720px; }
}


/* ==========================================================================
   27. SpaceHub UX refresh — November 2026
   Focus: clearer hierarchy, calmer surfaces, stronger interaction states,
   and predictable responsive behavior. Existing routes and workflows remain.
   ========================================================================== */
:root {
  --accent-purple: #6d55d9;
  --accent-purple-soft: #f1efff;
  --accent-blue: #3568d4;
  --focus-ring: 0 0 0 3px rgba(73, 105, 216, .18);
  --surface-shadow: 0 2px 10px rgba(15, 35, 65, .045);
  --surface-shadow-hover: 0 10px 26px rgba(15, 35, 65, .09);
}

body {
  background: #f5f7fb;
  color: #202d42;
  letter-spacing: -.006em;
}

::selection { color: #fff; background: #4f5fc7; }

h1, h2, h3, h4 { color: #172b4d; }
h1 { line-height: 1.18; }
p { line-height: 1.6; }

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(89, 105, 218, .42);
  outline-offset: 3px;
}

input, select, textarea {
  min-height: 44px;
  border-color: #d3dce9;
  border-radius: 9px;
  background-color: #fff;
}
textarea { min-height: 108px; }
input:focus, select:focus, textarea:focus {
  border-color: #6376d8;
  box-shadow: var(--focus-ring);
}
label { color: #34445d; font-size: 13px; font-weight: 650; }
.field-hint { line-height: 1.5; }

.primary, .secondary, .danger, .danger-outline, .button-link, .button-link-dark {
  min-height: 43px;
  border-radius: 9px;
  font-weight: 650;
  letter-spacing: 0;
}
.primary {
  color: #fff;
  background: linear-gradient(115deg, #315fcb 0%, #6552c9 100%);
  box-shadow: 0 3px 8px rgba(64, 84, 190, .16);
}
.primary:hover {
  background: linear-gradient(115deg, #2854b8 0%, #5743bb 100%);
  box-shadow: 0 6px 14px rgba(64, 84, 190, .2);
}
.secondary, .button-link-dark {
  color: #34445d;
  border-color: #d6deea;
  background: #fff;
}
.secondary:hover, .button-link-dark:hover {
  color: #304fa8;
  border-color: #aab9e5;
  background: #f7f8ff;
}
.danger, .danger-outline { border-radius: 9px; }
button:disabled, .primary:disabled, .secondary:disabled { box-shadow: none; }

.card, .form-card, .calendar-card, .room-card, .stat-card {
  border-color: #e2e8f1;
  box-shadow: var(--surface-shadow);
}
.card, .form-card { border-radius: 14px; }
.card-heading { align-items: center; }
.card-heading h2 { letter-spacing: -.015em; }
.card-heading a { color: #4a5fc0; }
.card-heading a:hover { color: #293f9a; text-decoration: underline; }

.sidebar {
  width: 264px;
  padding: 22px 15px 16px;
  background: linear-gradient(180deg, #101f3d 0%, #14294c 100%);
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar .brand { padding: 4px 9px 20px; margin-bottom: 12px; }
.sidebar .brand-mark, .brand-center .brand-mark, .landing-brand .brand-mark {
  color: #fff;
  background: linear-gradient(135deg, #3476e8 0%, #7256d9 100%);
  box-shadow: 0 5px 14px rgba(43, 75, 170, .2);
}
.sidebar .brand strong { font-size: 16px; }
.sidebar .brand small { max-width: 180px; line-height: 1.4; }
.sidebar nav a, .nav-button {
  min-height: 42px;
  margin: 3px 0;
  padding: 10px 12px;
  border-radius: 9px;
  color: #c3d0e5;
}
.sidebar nav a:hover, .nav-button:hover {
  color: #fff;
  background: rgba(255,255,255,.075);
}
.sidebar nav a.active {
  color: #fff;
  background: linear-gradient(100deg, rgba(53,104,212,.34), rgba(109,85,217,.22));
  box-shadow: inset 3px 0 0 #8c9cff;
}
.nav-section { color: #8295b6; }
.logout-form { border-color: rgba(255,255,255,.1); }
.logout-form .nav-button { color: #d2dced; }

.topbar {
  height: 68px;
  padding-inline: clamp(20px, 3vw, 42px);
  background: rgba(255,255,255,.96);
  border-bottom-color: #e6ebf3;
  box-shadow: 0 2px 8px rgba(15, 35, 65, .025);
  backdrop-filter: blur(12px);
}
.topbar > span { font-size: 14px; font-weight: 700; color: #233957; }
.topbar-user { gap: 12px; }
.topbar-user .who { line-height: 1.35; }
.topbar-user .who strong { display: block; font-size: 13px; }
.topbar-user .who small { display: block; margin-top: 2px; font-size: 11px; text-transform: capitalize; }
.notification-link { color: #4a5fc0; }
.avatar-sm {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #dce3f4;
  border-radius: 50%;
  color: #3c52a7;
  background: #f0f2ff;
  font-size: 12px;
  font-weight: 800;
}

.app-main {
  padding-top: calc(var(--topbar-h) + 32px);
}
.app-main > section { max-width: 1440px; }
.page-heading { align-items: center; margin-bottom: 24px; }
.page-heading h1 { font-size: clamp(25px, 2.2vw, 31px); letter-spacing: -.035em; }
.page-heading p { color: #66758c; line-height: 1.6; }
.eyebrow { color: #65728a; font-size: 10px; letter-spacing: .13em; }

.dashboard-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 3vw, 38px);
  background: linear-gradient(112deg, #142d56 0%, #244c89 58%, #4c4b9e 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(24, 48, 94, .13);
}
.dashboard-hero h1 { font-size: clamp(25px, 2.4vw, 32px); letter-spacing: -.035em; }
.dashboard-hero p { max-width: 610px; line-height: 1.65; }
.dashboard-hero .primary {
  color: #fff;
  background: linear-gradient(110deg, #4b83ef, #7865e2);
  border: 1px solid rgba(255,255,255,.18);
}
.dashboard-hero .primary:hover { background: linear-gradient(110deg, #3e73df, #6955d1); }
.dashboard-hero .button-link-dark {
  border-color: rgba(255,255,255,.38);
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(6px);
}

.stats { gap: 14px; }
.stat-card {
  position: relative;
  min-width: 0;
  padding: 19px 20px;
  border-radius: 13px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.stat-card:hover { border-color: #d4def0; box-shadow: var(--surface-shadow-hover); transform: translateY(-2px); }
.stat-card span { letter-spacing: .065em; }
.stat-card strong { font-size: clamp(27px, 2.5vw, 34px); }

.room-card, .facility-card {
  border-radius: 13px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.room-card:hover, .facility-card:hover {
  border-color: #d3dcf0;
  box-shadow: var(--surface-shadow-hover);
  transform: translateY(-2px);
}
.facility-card h2, .room-card h2 { color: #1c3152; }
.facility-card .room-meta span, .room-meta span {
  border-color: #e5eaf2;
  background: #f7f9fc;
}
.facility-toolbar {
  border: 1px solid #e2e8f1;
  border-radius: 13px;
  box-shadow: var(--surface-shadow);
  background: #fff;
}
.facility-toolbar input, .facility-toolbar select { min-width: 0; }
.facility-results { line-height: 1.5; }

.form-card { padding: clamp(20px, 2.6vw, 30px); }
.reservation-page .section-title {
  padding-top: 22px;
  margin-top: 26px;
}
.reservation-page .section-title:first-child { padding-top: 0; }
.step-number {
  width: 34px;
  height: 34px;
  color: #fff;
  background: linear-gradient(135deg, #356bd6, #7056d5);
  box-shadow: 0 3px 8px rgba(66, 86, 190, .16);
}
.availability-panel {
  border-color: #e0e7f1;
  background: #f8faff;
}
.time-summary, .facility-info {
  border-radius: 9px;
}
.form-footer {
  align-items: center;
}
.form-footer .muted { max-width: 520px; line-height: 1.55; }

.table-wrap {
  border-color: #e2e8f1;
  border-radius: 11px;
  box-shadow: none;
}
.table-wrap th {
  color: #53627a;
  background: #f6f8fc;
  font-size: 10px;
  letter-spacing: .075em;
}
.table-wrap td { line-height: 1.5; }
.table-wrap tbody tr { transition: background-color .12s ease; }
.table-wrap tbody tr:hover td { background: #f7f9ff; }
.table-wrap td strong { color: #263b5c; }
.badge {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .025em;
}
.flash { border-radius: 10px; }
.notice { border-radius: 10px; line-height: 1.6; }

.calendar-card { border-radius: 13px; }
.calendar-toolbar { background: #fff; }
.calendar-month-heading h2 { letter-spacing: -.02em; }
.calendar-nav {
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  border-color: #e0e6ef;
  border-radius: 9px;
}
.calendar-filter { background: #fff; }
.calendar-weekdays { background: #f7f8fc; }
.calendar-cell { min-height: 132px; }
.calendar-cell.today { box-shadow: inset 0 0 0 2px #6e83d9; }
.calendar-event { border-radius: 7px; }
.calendar-event strong { font-size: 10px; }

.auth-card, .public-card {
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 18px;
  box-shadow: 0 22px 70px rgba(4, 18, 42, .28);
}
.login-card .brand-center { margin-bottom: 30px; }
.login-card .brand-center h1 { margin-top: 12px; }
.login-form label { margin-top: 18px; }
.login-submit { min-height: 46px; margin-top: 10px; }

.empty, .empty-state { color: #6b7890; }
.empty-state { border: 1px dashed #d7dfeb; border-radius: 13px; background: #fbfcff; }

/* Responsive refinements */
@media (max-width: 1100px) {
  :root { --sidebar-w: 244px; --page-pad: 24px; }
  .stats { gap: 12px; }
  .topbar { padding-inline: 24px; }
}
@media (max-width: 900px) {
  :root { --page-pad: 20px; --topbar-h: 0px; }
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 12px 18px 10px;
    gap: 2px;
    background: #112344;
  }
  .sidebar .brand { padding: 2px 4px 11px; margin-bottom: 8px; }
  .sidebar nav {
    display: flex;
    flex: none;
    gap: 5px;
    overflow-x: auto;
    padding: 2px 0 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.24) transparent;
  }
  .sidebar nav a {
    min-height: 39px;
    padding: 8px 11px;
    border: 1px solid transparent;
    font-size: 12px;
  }
  .sidebar nav a.active { box-shadow: inset 0 -2px 0 #9aa9ff; }
  .sidebar nav a::before { width: 16px; height: 16px; }
  .logout-form { margin-top: 4px; padding-top: 5px; }
  .logout-form .nav-button { min-height: 36px; }
  .topbar {
    position: static;
    min-height: 54px;
    margin: 0 calc(-1 * var(--page-pad)) 22px;
    padding: 10px var(--page-pad);
    background: #fff;
  }
  .app-main { padding: 0 var(--page-pad) 38px; }
  .app-main > section { max-width: 100%; }
}
@media (max-width: 640px) {
  :root { --page-pad: 15px; }
  body { font-size: 14px; }
  .sidebar { padding-inline: 14px; }
  .sidebar .brand strong { font-size: 15px; }
  .sidebar .brand small { font-size: 10px; }
  .sidebar nav a { padding-inline: 10px; }
  .topbar {
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
  }
  .topbar > span { font-size: 13px; }
  .topbar-user { gap: 8px; }
  .topbar-user .who { max-width: 132px; }
  .topbar-user .who strong, .topbar-user .who small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .notification-link { margin-right: 0; font-size: 0; gap: 0; }
  .notification-link::before {
    content: "Notifications";
    font-size: 11px;
  }
  .avatar-sm { width: 32px; height: 32px; }
  .page-heading { gap: 12px; margin-bottom: 18px; }
  .page-heading h1 { font-size: 25px; }
  .dashboard-hero { padding: 23px 20px; border-radius: 13px; }
  .dashboard-hero h1 { font-size: 25px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 15px; }
  .stat-card strong { font-size: 27px; }
  .card, .form-card { padding: 17px; }
  .card-heading { gap: 8px; }
  .room-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .facility-card { padding: 17px; }
  .form-footer { gap: 12px; }
  .form-footer .muted { font-size: 12px; }
  .primary, .secondary, .danger, .danger-outline, .button-link, .button-link-dark { width: 100%; }
  .table-wrap .primary, .table-wrap .secondary, .table-wrap .danger,
  .table-wrap .danger-outline, .table-wrap .button-link, .table-wrap .button-link-dark,
  .table-wrap button, .table-wrap .row-action {
    width: auto;
    max-width: 100%;
  }
  .table-wrap { max-width: 100%; }
  .table-wrap table { min-width: 620px; }
  .calendar-card { border-radius: 11px; }
  .calendar-weekdays, .calendar-grid { min-width: 700px; }
  .calendar-cell { min-height: 108px; }
  .calendar-toolbar { grid-template-columns: 38px 1fr 38px; gap: 8px; }
  .calendar-filter { padding-inline: 15px; }
  .calendar-legend { padding-inline: 15px; }
  .auth-card, .public-card { padding: 23px 18px; }
  .facility-pagination { align-items: stretch; }
}
@media (max-width: 380px) {
  .topbar-user .who { display: none; }
  .notification-link::before { content: "Alerts"; }
  .dashboard-hero .hero-actions { flex-direction: column; }
  .dashboard-hero .hero-actions > a { width: 100%; }
  .stats { gap: 8px; }
  .stat-card { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .stat-card:hover, .room-card:hover, .facility-card:hover { transform: none; }
}


/* ===== SpaceHub logo (replaces the "SH" monogram) ===== */
.brand-logo-tile {
  display: inline-grid; place-items: center; flex: none; width: 58px; height: 38px; padding: 4px 5px;
  background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.brand-logo-tile img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-logo-tile--card { width: 64px; height: 40px; box-shadow: 0 2px 8px rgba(16,42,86,.18); }
.brand-logo-full { display: block; width: min(260px, 70%); height: auto; margin: 0 auto 4px; }
.brand-logo-side { display: block; flex: none; width: 88px; height: auto; }
@media (max-width: 640px) {
  .brand-logo-tile { width: 52px; height: 34px; }
  .brand-logo-side { width: 68px; }
}

/* In-app QR scanner */
.sidebar nav a[href="/checkin"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7V5a2 2 0 0 1 2-2h2M17 3h2a2 2 0 0 1 2 2v2M21 17v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2'/%3E%3Cpath d='M7 12h10'/%3E%3C/svg%3E"); }
.scanner-view { overflow: hidden; border-radius: 12px; background: #000; margin-bottom: 12px; aspect-ratio: 4 / 3; }
.scanner-view video { display: block; width: 100%; height: 100%; object-fit: cover; }
