/*
 * CUHK Booking System — Modern UI
 * Brand: CUHK Purple #6B3FA0, Gold #C4A35A
 */

/* ===== CSS Variables ===== */
:root {
  --primary: #6B3FA0;
  --primary-dark: #522D80;
  --primary-light: #8B6BBF;
  --primary-bg: #F4F0FA;
  --gold: #C4A35A;
  --gold-light: #F5ECD7;
  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --info: #3B82F6;
  --info-bg: #EFF6FF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --sidebar-width: 260px;
  --topbar-height: 0px;
  --transition: all 0.2s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

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

/* ===== Typography ===== */
h1, h2, h3, h4 { color: var(--gray-900); font-weight: 700; line-height: 1.3; }
h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.35rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }

p { margin-bottom: 0.5rem; }

/* ===== Flash Messages ===== */
.flash-container { padding: 0 1.5rem; max-width: 1200px; margin: 0 auto; }

.notice, .alert {
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.93rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideDown 0.3s ease;
}

.notice {
  background: var(--success-bg);
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.notice::before { content: "\2713"; font-weight: bold; }

.alert {
  background: var(--danger-bg);
  color: #991B1B;
  border: 1px solid #FECACA;
}

.alert::before { content: "\26A0"; }

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

/* ===== Auth Layout (Login/Signup) — No Sidebar ===== */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  padding: 2rem;
}

.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo h1 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.auth-logo p {
  color: var(--gray-500);
  font-size: 0.9rem;
}

.auth-card .form-group {
  margin-bottom: 1.1rem;
}

.auth-card .form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--gray-700);
  font-size: 0.9rem;
}

.auth-card .form-group input,
.auth-card .form-group select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: var(--transition);
  background: var(--gray-50);
}

.auth-card .form-group input:focus,
.auth-card .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(107,63,160,0.15);
  background: #fff;
}

.auth-card .btn-primary {
  width: 100%;
  margin-top: 0.5rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.2rem;
  font-size: 0.9rem;
  color: var(--gray-500);
}

.auth-footer a { font-weight: 600; }

.domain-email-input {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

.auth-card .form-group .domain-email-input input {
  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.domain-email-suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 0.8rem;
  border: 1.5px solid var(--gray-300);
  border-left: 1.5px solid var(--gray-300);
  border-top-right-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.88rem;
  white-space: nowrap;
}

.form-hint {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--gray-500);
}

.form-inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.password-rules {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.25rem;
}

.password-rule {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
}

.password-rule::before {
  content: "\2022";
  font-size: 1rem;
  line-height: 1;
  color: currentColor;
}

.password-rule.pending {
  color: #9a3412;
}

.password-rule.passed {
  color: #166534;
}

.password-rule.passed::before {
  content: "\2713";
  font-weight: 700;
}

.password-rules-summary {
  margin: 0.45rem 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.password-rules-summary.pending {
  color: #9a3412;
}

.password-rules-summary.passed {
  color: #166534;
}

.generated-password-panel {
  margin: 0.3rem 0 0.45rem;
  padding: 0.6rem 0.75rem;
  border: 1px dashed var(--warning);
  border-radius: var(--radius);
  background: #fffbeb;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.generated-password-panel[hidden] {
  display: none;
}

.generated-password-panel code {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.copy-feedback {
  font-size: 0.78rem;
  color: var(--gray-600);
}

/* ===== App Layout (Sidebar + Content) ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar-brand h2 {
  color: #fff;
  font-size: 1.15rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-brand .brand-icon {
  width: 32px;
  height: 32px;
  background: var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.sidebar-brand small {
  display: block;
  color: rgba(255,255,255,0.55);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.sidebar-section {
  padding: 0.25rem 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 1.25rem;
  color: rgba(255,255,255,0.78);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.sidebar-link.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-left-color: var(--gold);
}

.sidebar-link .nav-icon {
  font-size: 1.15rem;
  width: 1.4rem;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  overflow: hidden;
}

.sidebar-user-email {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
  display: block;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  text-transform: capitalize;
}

.sidebar-logout button,
.sidebar-logout input[type="submit"] {
  width: 100%;
  padding: 0.5rem;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.sidebar-logout button:hover,
.sidebar-logout input[type="submit"]:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* Main content area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.content-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.content-header .breadcrumb {
  font-size: 0.85rem;
  color: var(--gray-500);
}

.content-header .breadcrumb a { color: var(--gray-500); }
.content-header .breadcrumb a:hover { color: var(--primary); }

.content-body {
  flex: 1;
  padding: 1.75rem 2rem;
  max-width: 1400px;
}

/* Mobile sidebar toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-700);
  padding: 0.25rem;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

/* ===== Buttons ===== */
.btn, button, input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary, .button-primary, input[type="submit"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover, .button-primary:hover, input[type="submit"]:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-secondary, .button-secondary {
  background: #fff;
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.btn-secondary:hover, .button-secondary:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
  color: var(--gray-800);
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-success:hover {
  background: #059669;
  border-color: #059669;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #DC2626;
  border-color: #DC2626;
}

.btn-warning {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.btn-group form { margin: 0; display: inline-flex; }

/* ===== Cards ===== */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow); }

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2, .card-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.card-body { padding: 1.25rem; }

.card-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.temp-password-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.75rem 0;
}

.temp-password-value {
  display: inline-block;
  padding: 0.65rem 0.85rem;
  border: 1px dashed var(--warning);
  border-radius: var(--radius);
  background: #fffbeb;
  color: var(--gray-900);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  word-break: break-all;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label, label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--gray-700);
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.93rem;
  font-family: inherit;
  color: var(--gray-800);
  background: #fff;
  transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(107,63,160,0.12);
}

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

/* ===== Tables ===== */
.resource-grid-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  margin: 1rem 0 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.resource-grid-table th,
.resource-grid-table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
}

.resource-grid-table thead th {
  background: var(--primary-bg);
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.resource-grid-table thead th a {
  color: var(--primary-dark);
  text-decoration: none;
}

.resource-grid-table thead th a:hover {
  color: var(--primary);
}

.resource-grid-table tbody tr {
  transition: var(--transition);
}

.resource-grid-table tbody tr:hover {
  background: var(--gray-50);
}

.resource-grid-table tbody tr:nth-child(even) {
  background: var(--gray-50);
}

.resource-grid-table tbody tr:nth-child(even):hover {
  background: var(--gray-100);
}

.resource-grid-table tbody tr:last-child td {
  border-bottom: none;
}

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

.venue-requests-table {
  min-width: 980px;
  table-layout: auto;
}

.venue-requests-table th,
.venue-requests-table td {
  white-space: nowrap;
}

.venue-requests-table .venue-request-description {
  min-width: 220px;
  max-width: 320px;
  white-space: normal;
  line-height: 1.4;
}

.venue-requests-table .venue-request-email {
  max-width: 220px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.venue-requests-table .venue-request-actions,
.venue-requests-table .venue-request-actions-header {
  min-width: 96px;
  text-align: right;
  white-space: nowrap;
}

.venues-table {
  min-width: 860px;
  table-layout: fixed;
}

.venues-table .venues-col-name {
  width: 24%;
}

.venues-table .venues-col-name a {
  overflow-wrap: anywhere;
}

.venues-table .venues-col-description {
  width: 42%;
  white-space: normal;
  line-height: 1.4;
}

.venues-table .venues-col-department {
  width: 18%;
  white-space: nowrap;
}

.venues-table .venues-col-actions {
  width: 16%;
  text-align: right;
  white-space: nowrap;
}

.venues-actions-group {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.venues-actions-group .btn,
.venues-actions-group form {
  flex: 0 0 auto;
}

/* My bookings table - same styling */
table:not(.resource-grid-table):not(.TimeTable):not(.analytics-heatmap table) {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  margin: 1rem 0 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

table:not(.resource-grid-table):not(.TimeTable):not(.analytics-heatmap table) th,
table:not(.resource-grid-table):not(.TimeTable):not(.analytics-heatmap table) td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.9rem;
}

table:not(.resource-grid-table):not(.TimeTable):not(.analytics-heatmap table) thead th {
  background: var(--primary-bg);
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

table:not(.resource-grid-table):not(.TimeTable):not(.analytics-heatmap table) tbody tr {
  transition: var(--transition);
}

table:not(.resource-grid-table):not(.TimeTable):not(.analytics-heatmap table) tbody tr:hover {
  background: var(--gray-50);
}

/* ===== Status Badges ===== */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-pending { background: var(--warning-bg); color: #92400E; border: 1px solid #FDE68A; }
.badge-approved { background: var(--success-bg); color: #065F46; border: 1px solid #A7F3D0; }
.badge-rejected { background: var(--danger-bg); color: #991B1B; border: 1px solid #FECACA; }
.badge-cancelled { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-300); }
.badge-under-review { background: var(--info-bg); color: #1E40AF; border: 1px solid #BFDBFE; }
.badge-borrowed { background: #FDF4FF; color: #86198F; border: 1px solid #F5D0FE; }
.badge-returned { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-300); }
.badge-role { background: var(--primary-bg); color: var(--primary); border: 1px solid #D4C5ED; }

/* ===== Dashboard Cards Grid ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.dash-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.dash-card .dash-icon {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.dash-card h3 {
  font-size: 1rem;
  margin: 0;
  color: var(--gray-900);
}

.dash-card p {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin: 0;
}

.dash-card a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: auto;
}

/* ===== Stat Cards ===== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  text-align: center;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.25rem;
}

/* ===== Page Actions Row ===== */
.page-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-actions .spacer { flex: 1; }

/* ===== Detail View ===== */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.detail-item {
  padding: 0.85rem 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

.detail-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  margin-bottom: 0.2rem;
}

.detail-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
}

.venue-request-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.venue-request-review-action {
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

.venue-request-review-action h4 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: var(--gray-900);
}

.venue-request-review-action p {
  margin: 0 0 0.8rem;
}

.venue-request-approve-action {
  background: var(--success-bg);
  border-color: #A7F3D0;
}

.venue-request-reject-action {
  background: var(--danger-bg);
  border-color: #FECACA;
}

.venue-request-action-form,
.venue-request-reject-form {
  margin: 0;
}

.venue-request-review-button {
  width: 100%;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.empty-state h3 {
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto 1rem;
}

/* ===== Booking Planner ===== */
.booking-planner {
  display: grid;
  gap: 1rem;
  max-width: 920px;
}

.booking-config-card {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.booking-config-header {
  display: grid;
  gap: 0.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
}

.booking-venue-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--primary-dark);
}

.booking-date-filter {
  padding: 1rem 1.25rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.booking-date-filter-inline {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.booking-date-filter-inline .booking-field {
  max-width: 280px;
}

.booking-form {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.booking-form-stacked {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.booking-field {
  display: grid;
  gap: 0.35rem;
}

.booking-time-fields {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
}

.booking-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.booking-errors {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  background: var(--danger-bg);
  border: 1px solid #FECACA;
  color: #991B1B;
}

.booking-error-list {
  margin: 0;
  padding-left: 1.2rem;
}

.booking-resource-summary {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  background: var(--primary-bg);
  border: 1px solid #D4C5ED;
}

.booking-actions {
  display: flex;
  justify-content: flex-start;
}

/* ===== Timetable ===== */
.timetable-legend {
  display: flex;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.timetable-chip {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.TimeTable {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  max-width: 920px;
  margin: 0.75rem 0 1rem;
  font-size: 0.93rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.TimeTable th,
.TimeTable td {
  border: 1px solid var(--gray-200);
  vertical-align: middle;
}

.TimeTableTitleCell {
  width: 210px;
  padding: 0.65rem 0.85rem;
  font-weight: 700;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 0.85rem;
  white-space: nowrap;
  text-align: center;
}

.TimeTableTitleCellOneDayOneFacilityView {
  width: 150px;
  padding: 0.65rem 0.85rem;
  font-weight: 700;
  background: var(--primary-bg);
  color: var(--primary-dark);
  text-align: center;
}

.TimeTableCell_Available {
  background: #FEF9C3;
  padding: 0.3rem 0.5rem;
}

.TimeTableCell_Full {
  background: #FECACA;
  padding: 0.3rem 0.5rem;
}

.TimeTableCell_Selected {
  background: #BBF7D0;
  padding: 0.3rem 0.5rem;
}

.timetable-status-cell {
  text-align: center;
}

.timetable-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  font-size: 0.8rem;
  line-height: 1.35;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
}

.timetable-time-range {
  display: inline-block;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.timetable-slot-unavailable {
  background: #FECACA;
  color: #991B1B;
}

.timetable-slot-selected {
  background: #BBF7D0;
  color: #065F46;
}

.timetable-slot-available {
  background: #FEF9C3;
  color: #92400E;
}

.timetable-note {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--gray-500);
}

/* ===== Confirmation Card ===== */
.confirmation-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.confirmation-card h2 {
  font-size: 1.05rem;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.confirmation-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ===== Approval Dashboard Actions ===== */
.approval-bookings-table {
  min-width: 1120px;
}

.approval-actions-cell {
  min-width: 260px;
}

.approval-action-stack {
  display: grid;
  gap: 0.5rem;
}

.approval-approve-form,
.approval-reject-form {
  margin: 0;
}

.approval-approve-button,
.approval-reject-button {
  width: 100%;
}

.approval-reject-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem;
  align-items: end;
}

.approval-reject-input {
  min-width: 0;
}

/* ===== Analytics Dashboard ===== */
.analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.analytics-card {
  color: #fff;
  padding: 1.35rem;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.analytics-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.analytics-card-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.analytics-panel {
  background: #fff;
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.analytics-panel h2 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: var(--gray-800);
}

.analytics-filter {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.analytics-filter form {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.analytics-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--gray-400);
  text-align: center;
}

.analytics-empty-state::before {
  content: "\1F4CA";
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.analytics-heatmap {
  margin-top: 1.5rem;
  background: #fff;
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.analytics-heatmap table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 0.82rem;
}

.analytics-heatmap th,
.analytics-heatmap td {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--gray-200);
}

.analytics-heatmap th {
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-weight: 700;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .analytics-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.show {
    display: block;
  }
  .mobile-toggle {
    display: block;
  }
  .main-content {
    margin-left: 0;
  }
  .content-body {
    padding: 1.25rem 1rem;
  }
  .content-header {
    padding: 1rem;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .booking-time-fields {
    grid-template-columns: 1fr;
  }
  .booking-date-filter-inline .booking-field {
    max-width: 100%;
  }
  .TimeTableTitleCell {
    width: 170px;
  }
  .venues-table {
    min-width: 760px;
  }
  .approval-bookings-table {
    min-width: 980px;
  }
  .approval-actions-cell {
    min-width: 220px;
  }
  .approval-reject-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .analytics-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .analytics-filter form {
    flex-direction: column;
    align-items: stretch;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .page-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== Utilities ===== */
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 0.85rem; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.inline { display: inline; }
