:root{
  /* Brand color extracted/suggested from provided logo */
  --brand-color: #0f3b45; /* deep teal from logo */
  --brand-accent: #bfa57f; /* warm paper accent */
  --brand-bg: #ffffff;
}
.navbar { background: var(--brand-color) !important; }
.main-sidebar { background: linear-gradient(180deg, rgba(15,59,69,1) 0%, rgba(11,45,51,1) 100%) !important; }
.brand-link { display:flex; align-items:center; gap:10px; }
brand-link img { max-height:100px; margin: 0 auto; }
.brand-text { color: #fff !important; font-weight:600; }

/* Centered logo in top navbar (uses SVG placeholder at /assets/images/logo.svg). */
.main-header { position: relative; }
.main-header::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 200px; /* adjust as needed */
  max-width: 60%;
  height: 100px;
  background-image: url('/assets/images/logo.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none; /* don't block clicks */
  z-index: 1030; /* above navbar background but below dropdowns */
}
.brand-text { color: #fff !important; font-weight:600; }

/* Hamburger menu icon color - gold accent matching logo background */
.navbar .nav-link[data-widget="pushmenu"] {
  color: var(--brand-accent) !important; /* #bfa57f - warm gold from logo */
}
.navbar .nav-link[data-widget="pushmenu"]:hover {
  color: #d4b88e !important; /* lighter gold on hover */
}

/* small accent for cards */
.card { border-top: 3px solid rgba(15,59,69,0.08); }

/* Purple background for monthly bookings counter */
.bg-purple { background-color: #6f42c1 !important; color: #fff; }

/* Primary UI elements */
.small-box.bg-info { background: var(--brand-color) !important; border-color: var(--brand-color) !important; color: #fff; }
.btn-primary { background-color: var(--brand-color); border-color: var(--brand-color); }
.nav-sidebar .nav-link.active { background-color: rgba(255,255,255,0.05); border-left: 3px solid var(--brand-accent); }

/* Make sidebar nav links readable on dark background */
.nav-sidebar .nav-link {
  color: rgba(255,255,255,0.9) !important;
}
.nav-sidebar .nav-link i, .nav-sidebar .nav-link .nav-icon {
  color: rgba(255,255,255,0.85) !important;
}
.nav-sidebar .nav-link.active {
  color: #fff !important;
  background-color: rgba(255,255,255,0.06) !important;
}

/* Hover animation for sidebar items */
.nav-sidebar .nav-link {
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
.nav-sidebar .nav-link:hover, .nav-sidebar .nav-link:focus {
  transform: translateX(6px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  background-color: rgba(255,255,255,0.04) !important;
}

/* Accent for table headers */
table.dataTable thead th { background: rgba(15,59,69,0.06); }

/* Make Select2 single-select match Bootstrap .form-control height and padding */
.select2-container--default .select2-selection--single {
  height: calc(1.5em + .75rem + 2px); /* roughly match .form-control height */
  padding: .375rem .75rem;
  border: 1px solid #ced4da;
  border-radius: .25rem;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 1.5;
  padding-left: 0;
  padding-right: 0;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: calc(1.5em + .75rem + 2px);
}

/* Ensure select2 inside input-sized columns stretches full height */
.form-control + .select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--single.form-control {
  height: auto;
}

/* Booking page: keep client select and + button aligned */
.input-group { display: flex; align-items: center; }
.input-group .form-control { display: block; flex: 0 1 auto; min-width: 0; }

/* Ensure Select2 renders as a flexible child inside input-group */
.input-group { display: flex; align-items: center; flex-wrap: nowrap; }
.input-group .select2-container,
.input-group .select2-container--default {
  display: flex !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: 100% !important; /* override inline widths set by Select2 */
  box-sizing: border-box !important;
}
.input-group .select2-container--default .select2-selection--single {
  height: calc(1.5em + .75rem + 2px);
  display: flex;
  align-items: center;
  padding: .375rem .75rem;
  box-sizing: border-box;
}

/* Keep the append button visually attached and same height as the select */
.input-group .input-group-append { display: flex; }
.input-group .input-group-append .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  height: 100% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .375rem 0.75rem;
  margin-left: 10px;
  flex: 0 0 auto; /* width controlled by padding */
}
.input-group .input-group-append .btn .fas { font-size: 0.9rem; }

/* Safety: if Select2 injects a wrapper around the select, ensure the original select doesn't force layout */
.input-group select.form-control { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Force the Select2 selection element to fill its container */
.input-group .select2-container--default .select2-selection--single {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

/* Ensure the rendered text area doesn't clip */
.input-group .select2-container--default .select2-selection__rendered {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ensure logged-in user info is white on dark backgrounds (navbar / sidebar) and has a subtle badge for contrast */
#user-name, #user-role, #logout-link {
  color: #fff !important;
  background: rgba(0,0,0,0.28);
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
  line-height: 1;
}

/* user-panel links in sidebar */
.user-panel .info, .user-panel .info a {
  color: #fff !important;
  background: rgba(0,0,0,0.18);
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

/* Force brand logo sizing and centering across all pages (override inline styles if present) */
#brand-logo {
  max-height: 100px !important;
  display: block;
  margin: 0 auto !important;
}

/* Logo used on login page */
#login-logo { max-height: 80px; display:block; margin: 8px auto; }

/* Toast notifications: ensure visibility on mobile/tablet devices */
#toast-container {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  z-index: 99999 !important;
  pointer-events: none !important;
  max-width: calc(100vw - 40px) !important;
}

/* Ensure toasts are visible above sidebar and modals on mobile */
.toast {
  pointer-events: auto !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
  margin-bottom: 10px !important;
}

/* On small screens (phones/tablets), adjust toast positioning */
@media (max-width: 768px) {
  #toast-container {
    top: 10px !important;
    right: 10px !important;
    left: 10px !important;
    right: 10px !important;
    max-width: calc(100vw - 20px) !important;
  }
  
  .toast {
    width: 100% !important;
    max-width: 100% !important;
  }
}
