/* Custom Modal Styling */
.custom-modal {
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  background-color: #fff;
}

.custom-modal .modal-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  padding: 15px 20px;
}

.custom-modal .modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

.custom-modal .modal-body {
  padding: 20px;
}

.custom-modal .modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 10px 20px;
  background-color: #f8f9fa;
}

/* Custom File Upload */
.custom-file-upload {
  position: relative;
  display: flex;
  align-items: center;
  border: 2px dashed #d1d8e0;
  border-radius: 6px;
  padding: 15px;
  background-color: #f9f9f9;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.custom-file-upload:hover {
  border-color: #007bff;
  background-color: #f1f5f9;
}

.custom-file-upload input[type="file"] {
  opacity: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.custom-file-upload .file-name {
  flex-grow: 1;
  font-size: 0.9rem;
  color: #495057;
  margin-right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-file-upload .choose-file {
  white-space: nowrap;
  border: 1px solid #ced4da;
  color: #495057;
  transition: all 0.3s ease;
}

.custom-file-upload .choose-file:hover {
  background-color: #007bff;
  color: #fff;
  border-color: #007bff;
}

/* Upload Button */
.btn-upload {
  padding: 10px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.btn-upload:hover {
  background-color: #0056b3;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
  .custom-modal .modal-dialog {
    margin: 10px;
  }

  .custom-file-upload {
    flex-direction: column;
    align-items: stretch;
  }

  .custom-file-upload .file-name {
    margin-bottom: 10px;
    text-align: center;
  }

  .custom-file-upload .choose-file {
    width: 100%;
  }
}

/* Ensure buttons and links align with dashboard theme */
.btn-primary {
  background-color: #007bff;
  border-color: #007bff;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: #0056b3;
  border-color: #004085;
}

.btn-outline-secondary {
  border-color: #ced4da;
  color: #495057;
  transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
  background-color: #696cff;
  border-color: #696cff;
  color: #fff;
}

.app-brand-text.demo {

  text-transform: capitalize;
}

#appointment_table .custom-btn {
  margin-right: 10px;
}

.select2-container .select2-selection--single {

  height: 38px !important;


}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 38px !important;
}

.btn-close span {
  display: none;
}

.alert-success {

  text-transform: capitalize !important;
}



.app-brand-logo {
  display: none;
}

.layout-menu-collapsed .app-brand-logo {
  display: block;
}

.layout-menu-hover .app-brand-logo {
  display: none;
}

.menu-toggle::after {
  right: 10px;
}


.layout-navbar.navbar-detached.container-xxl {
  max-inline-size: calc(1920px - 1.625rem * 2);
}


@media (min-width: 1400px) {

  .container-xxl,
  .container-xl,
  .container-lg,
  .container-md,
  .container-sm,
  .container {
    max-width: 1920px;
  }
}

/* Fix Select2 alignment inside Bootstrap input-groups */
.input-group .select2-container--default {
  flex: 1 1 auto;
  width: 1% !important;
}

.input-group .select2-container--default .select2-selection--single {
  height: 38px !important;
  display: flex;
  align-items: center;
  border-color: #d9dee3 !important;
}

.input-group .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px !important;
}

/* When Select2 is preceded by input-group-text, remove left border radius */
.input-group>.input-group-text+.select2-container--default .select2-selection--single {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* When Select2 is followed by a button, remove right border radius */
.input-group>.select2-container--default:not(:last-child) .select2-selection--single {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Sidebar menu scrollbar customization */
.menu-inner.ps {
  overflow-y: auto !important;
}

.menu-inner::-webkit-scrollbar {
  width: 6px;
}

.menu-inner::-webkit-scrollbar-track {
  background: transparent;
}

.menu-inner::-webkit-scrollbar-thumb {
  background: rgba(105, 108, 255, 0.15);
  border-radius: 4px;
}

.menu-inner::-webkit-scrollbar-thumb:hover {
  background: rgba(105, 108, 255, 0.4);
}

/* Perfect scrollbar rails customization */
.ps__rail-y {
  width: 8px !important;
  background-color: transparent !important;
  left: auto !important;
  right: 2px !important;
}

.ps__rail-y:hover>.ps__thumb-y,
.ps__rail-y:focus>.ps__thumb-y,
.ps__rail-y.ps--clicking .ps__thumb-y {
  background-color: #696cff !important;
  width: 6px !important;
}

.ps__thumb-y {
  background-color: rgba(105, 108, 255, 0.3) !important;
  border-radius: 4px !important;
  width: 4px !important;
  transition: background-color 0.2s ease, width 0.2s ease;
}

/* Active styling for all active menu links (text and icons) at any nested level */
.bg-menu-theme .menu-inner .menu-item.active>.menu-link,
.bg-menu-theme .menu-inner .menu-item.active>.menu-link i {
  color: #696cff !important;
}

/* Background highlight ONLY for the active leaf nodes (like Create Area or Locations List) */
.bg-menu-theme .menu-inner .menu-item.active:not(.open)>.menu-link {
  background-color: rgba(105, 108, 255, 0.16) !important;
  font-weight: 600;
}

/* Hide default Sneat submenu bullet dots since we use custom Boxicons */
.menu-vertical .menu-sub .menu-link::before {
  display: none !important;
}

/* Submenu left indentation reduction, perfect icon alignment, and full text display */
.menu-vertical .menu-sub .menu-link {
  padding-left: 1.85rem !important;
  padding-right: 0.5rem !important;
}

.layout-wrapper:not(.layout-horizontal) .menu-vertical .menu-inner>.menu-item .menu-sub .menu-sub .menu-link {
  padding-left: 2.5rem !important;
}

.layout-wrapper:not(.layout-horizontal) .menu-vertical .menu-inner>.menu-item .menu-sub .menu-sub .menu-sub .menu-link {
  padding-left: 3rem !important;
}

.menu-vertical .menu-sub .menu-link .menu-icon {
  width: 1.5rem !important;
  min-width: 1.5rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-size: 1.05rem !important;
  margin-right: 0.5rem !important;
  flex-shrink: 0 !important;
}

.menu-vertical .menu-sub .menu-link div {
  white-space: normal !important;
  line-height: 1.3 !important;
}

/* Ensure the password visibility toggle is clickable and sits above the input field overlap */
#toggle-password,
[id^="toggle-password"],
.toggle-password,
.input-group-text.toggle-password {
  position: relative !important;
  z-index: 5 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Eliminate horizontal scrollbar on DataTables while keeping responsive dtr-control expand arrow */
.card-body .table-responsive,
.table-responsive {
  overflow-x: hidden !important;
}

table.dataTable {
  width: 100% !important;
}

/* Ensure buttons across card headers, action toolbars, and tables never break into multi-line text wrapping awkwardly */
.btn {
  white-space: nowrap;
}

.card-header .btn,
.table-actions .btn,
.table td .btn {
  white-space: nowrap !important;
}

.card-header {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.table td .d-flex {
  flex-wrap: wrap !important;
  gap: 0.35rem !important;
}

/* Global DataTables Controls Responsiveness - Search records always stuck to the right */
.dataTables_wrapper .row:first-child,
.dt-container .dt-layout-row:first-child {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  row-gap: 0.5rem;
}

.dataTables_wrapper .row:first-child>[class*="col-"],
.dt-container .dt-layout-row:first-child>[class*="col-"] {
  width: auto !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.dataTables_wrapper .row:first-child>[class*="col-"]:last-child,
.dt-container .dt-layout-row:first-child>[class*="col-"]:last-child {
  margin-left: auto !important;
}

.dataTables_filter,
.dt-search {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  margin: 0 0 0 auto !important;
  width: auto !important;
  text-align: right !important;
}

.dataTables_filter label,
.dt-search label {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  margin: 0 !important;
  white-space: nowrap !important;
  width: auto !important;
}

.dataTables_filter input,
.dt-search input {
  border: 1px solid #d9dee3;
  border-radius: 0.375rem;
  padding: 0.422rem 0.75rem;
  margin-left: 0.5rem !important;
  outline: none;
  color: #566a7f;
  background-color: #fff;
  font-size: 0.875rem;
  width: 170px !important;
  max-width: 100% !important;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.dataTables_wrapper .row:last-child,
.dt-container .dt-layout-row:last-child {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.75rem 0;
  border-top: 1px solid #d9dee3;
  margin-top: 1rem !important;
  margin-bottom: 0 !important;
  row-gap: 0.75rem;
}

.dataTables_wrapper .row:last-child>[class*="col-"],
.dt-container .dt-layout-row:last-child>[class*="col-"] {
  width: auto !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.dataTables_wrapper .row:last-child>[class*="col-"]:last-child,
.dt-container .dt-layout-row:last-child>[class*="col-"]:last-child {
  margin-left: auto !important;
}

@media (max-width: 575.98px) {

  .dataTables_filter input,
  .dt-search input {
    width: 135px !important;
    font-size: 0.8125rem;
    padding: 0.35rem 0.5rem;
  }

  .dataTables_length,
  .dt-length {
    font-size: 0.8125rem;
  }

  .dataTables_length select,
  .dt-length select {
    padding: 0.25rem 1.4rem 0.25rem 0.4rem;
    font-size: 0.8125rem;
    margin: 0 0.2rem;
  }

  .dataTables_wrapper .row:last-child,
  .dt-container .dt-layout-row:last-child {
    justify-content: center !important;
    text-align: center !important;
  }

  .dataTables_wrapper .row:last-child>[class*="col-"],
  .dt-container .dt-layout-row:last-child>[class*="col-"] {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .dataTables_info,
  .dt-info {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .dataTables_paginate,
  .dt-paging {
    width: 100% !important;
    justify-content: center !important;
    margin-left: 0 !important;
  }

  .dataTables_wrapper .pagination,
  .dt-container .pagination {
    justify-content: center !important;
    width: 100%;
  }
}

/* Responsive Section Tabs - Wrap tabs down onto new lines while preserving standard tab aesthetics */
.nav-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  row-gap: 0.35rem;
  border-bottom: 1px solid #d9dee3;
}

.nav-tabs .nav-link {
  white-space: nowrap !important;
}

/* Responsive Badges & Status Labels */
.badge,
#videoStatusBadge {
  white-space: nowrap !important;
}

/* Summernote Modal & Backdrop Z-Index Fix - Elevate above Sneat fixed navbar */
body>.note-modal-backdrop,
.note-modal-backdrop {
  z-index: 10850 !important;
}

body>.note-modal,
.note-modal {
  z-index: 10855 !important;
}

.note-modal-content,
.note-modal .modal-dialog {
  margin-top: 110px !important;
  border: 0 !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 0.5rem 2rem rgba(67, 89, 113, 0.25) !important;
  background: #ffffff !important;
  overflow: hidden !important;
}

.note-modal-header {
  padding: 1.25rem 1.5rem 1rem 1.5rem !important;
  border-bottom: 1px solid #d9dee3 !important;
  display: flex !important;
  flex-direction: row-reverse !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: #ffffff !important;
}

.note-modal-title {
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  color: #566a7f !important;
  margin: 0 !important;
}

.note-modal-body {
  padding: 1.5rem !important;
  color: #697a8d !important;
}

.note-modal .note-form-label,
.note-modal label {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: #566a7f !important;
  margin-bottom: 0.375rem !important;
}

.note-modal .note-input,
.note-modal input[type="text"],
.note-modal input[type="file"] {
  border: 1px solid #d9dee3 !important;
  border-radius: 0.375rem !important;
  padding: 0.4375rem 0.875rem !important;
  font-size: 0.9375rem !important;
  color: #697a8d !important;
  background-color: #ffffff !important;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out !important;
}

.note-modal .note-input:focus,
.note-modal input[type="text"]:focus {
  border-color: #696cff !important;
  box-shadow: 0 0 0 0.25rem rgba(105, 108, 255, 0.1) !important;
  outline: 0 !important;
}

/* Right-aligned Sneat Theme Primary Modal Button */
.note-modal-footer {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: 1rem 1.5rem !important;
  height: auto !important;
  border-top: 1px solid #d9dee3 !important;
  background: #fcfcfd !important;
  border-bottom-left-radius: 0.5rem !important;
  border-bottom-right-radius: 0.5rem !important;
}

.note-modal-footer .note-btn,
.note-modal-footer .btn,
.note-modal-footer input[type="button"],
.note-modal-footer button {
  float: none !important;
  background-color: #696cff !important;
  border-color: #696cff !important;
  color: #ffffff !important;
  border-radius: 0.375rem !important;
  padding: 0.5rem 1.25rem !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  box-shadow: 0 0.125rem 0.25rem 0 rgba(105, 108, 255, 0.4) !important;
  transition: all 0.2s ease-in-out !important;
  margin: 0 !important;
  cursor: pointer !important;
}

.note-modal-footer .note-btn:hover,
.note-modal-footer .btn:hover,
.note-modal-footer input[type="button"]:hover,
.note-modal-footer button:hover {
  background-color: #5f61e6 !important;
  border-color: #5f61e6 !important;
  color: #ffffff !important;
  box-shadow: 0 0.25rem 0.5rem 0 rgba(105, 108, 255, 0.4) !important;
}

.note-modal-footer .note-btn:disabled,
.note-modal-footer .btn:disabled,
.note-modal-footer input[type="button"]:disabled,
.note-modal-footer button:disabled,
.note-modal-footer .note-btn[disabled] {
  opacity: 0.65 !important;
  background-color: #696cff !important;
  border-color: #696cff !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

.note-popover {
  z-index: 10860 !important;
}

.note-tooltip {
  z-index: 10865 !important;
}

/* Summernote Fullscreen Editor Stacking & Overlay Fix */
.note-editor.note-frame.fullscreen,
.note-editor.note-airframe.fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 10800 !important;
  background-color: #ffffff !important;
}

body.note-fullscreen-body #layout-navbar,
body.note-fullscreen-body #layout-menu,
body.note-fullscreen-body .layout-navbar,
body.note-fullscreen-body .layout-menu,
html.note-fullscreen-body #layout-navbar,
html.note-fullscreen-body #layout-menu,
html.note-fullscreen-body .layout-navbar,
html.note-fullscreen-body .layout-menu {
  z-index: 1000 !important;
}

body.note-fullscreen-body .layout-page,
html.note-fullscreen-body .layout-page {
  z-index: 10700 !important;
}

/* ==========================================
   Pill Style Location Dropdown Filter & Popup Menu
   ========================================== */
.location-pill-filter {
  position: relative;
  display: inline-block;
}

.location-pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  background: #f4f5fa;
  border: 1px solid rgba(105, 108, 255, 0.25);
  border-radius: 50rem;
  padding: 0.35rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #000000;
  transition: all 0.25s ease-in-out;
  box-shadow: 0 2px 6px rgba(105, 108, 255, 0.08);
  cursor: pointer;
  outline: none;
  max-width: 100%;
  overflow: hidden;
}

.location-pill-button:hover,
.location-pill-button:focus,
.location-pill-button[aria-expanded="true"] {
  background: #ffffff;
  border-color: #696cff;
  color: #000000;
  box-shadow: 0 4px 14px rgba(105, 108, 255, 0.2);
}

.location-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(105, 108, 255, 0.12);
  color: #696cff;
  font-size: 1.05rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.location-pill-text {
  margin-right: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: clamp(100px, 35vw, 240px);
  color: #000000 !important;
  font-weight: 600 !important;
}

.location-pill-arrow {
  color: #696cff;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.location-pill-button[aria-expanded="true"] .location-pill-arrow {
  transform: rotate(180deg);
}

/* Floating Pill Menu Card - Clean Container Bounds */
.location-pill-menu {
  border-radius: 18px !important;
  border: 1px solid rgba(105, 108, 255, 0.22) !important;
  box-shadow: 0 12px 35px rgba(105, 108, 255, 0.18) !important;
  padding: 8px !important;
  background-color: #ffffff !important;
  min-width: 240px !important;
  max-width: 340px !important;
  max-height: 320px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  margin-top: 6px !important;
  z-index: 1055 !important;
}

/* Individual Pill Menu Items - Text Wrapping & Containment */
.location-pill-item {
  border-radius: 50rem !important;
  padding: 0.5rem 1rem !important;
  margin: 3px 0 !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #333333 !important;
  display: flex !important;
  align-items: center !important;
  transition: all 0.2s ease-in-out !important;
  cursor: pointer !important;
  white-space: normal !important;
  word-break: break-word !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

.location-pill-item:hover,
.location-pill-item:focus {
  background-color: rgba(105, 108, 255, 0.12) !important;
  color: #000000 !important;
  font-weight: 600 !important;
  transform: translateX(3px);
}

/* Selected item styling - Soft background with crisp BLACK text */
.location-pill-item.active,
.location-pill-item:active {
  background-color: rgba(105, 108, 255, 0.18) !important;
  border: 1px solid rgba(105, 108, 255, 0.4) !important;
  color: #000000 !important;
  font-weight: 700 !important;
}

.location-pill-item.active i,
.location-pill-item.active .text-primary,
.location-pill-item.active .text-muted {
  color: #696cff !important;
}

/* ==========================================
   Gate Pass Canvas Container Fit-Content Fix
   ========================================== */
.gate-pass-canvas-item {
  background: #ffffff !important;
  display: inline-block !important;
  width: fit-content !important;
  max-width: 100% !important;
  margin: 0 auto !important;
}

.gate-pass-canvas-item>* {
  max-width: 480px !important;
  margin: 0 auto !important;
}

/* ==========================================
   Sidebar Brand Logo Fit & Alignment Styles
   ========================================== */
.sidebar-brand-logo-img {
  max-height: 60px !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: left center !important;
  transition: all 0.25s ease-in-out;
}

/* Default state (Expanded Sidebar) */
.sidebar-brand-logo-mini {
  display: none !important;
}

.sidebar-brand-logo-full {
  display: flex !important;
}

/* Collapsed Sidebar (when closed / not hovered) */
.layout-menu-collapsed:not(.layout-menu-hover) .sidebar-brand-logo-full,
html.layout-menu-collapsed:not(.layout-menu-hover) .sidebar-brand-logo-full {
  display: none !important;
}

.layout-menu-collapsed:not(.layout-menu-hover) .sidebar-brand-logo-mini,
html.layout-menu-collapsed:not(.layout-menu-hover) .sidebar-brand-logo-mini {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Hover state on Collapsed Sidebar (expands menu) */
.layout-menu-collapsed.layout-menu-hover .sidebar-brand-logo-mini,
html.layout-menu-collapsed.layout-menu-hover .sidebar-brand-logo-mini,
.layout-menu-hover .sidebar-brand-logo-mini {
  display: none !important;
}

.layout-menu-collapsed.layout-menu-hover .sidebar-brand-logo-full,
html.layout-menu-collapsed.layout-menu-hover .sidebar-brand-logo-full,
.layout-menu-hover .sidebar-brand-logo-full {
  display: flex !important;
}

/* ==========================================
   Hide Sidebar Scrollbar Bar (Scrollable without visible bar)
   ========================================== */
#layout-menu,
.layout-menu,
.layout-menu .menu-inner,
.menu-inner,
.menu-inner-shadow {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

#layout-menu::-webkit-scrollbar,
.layout-menu::-webkit-scrollbar,
.layout-menu .menu-inner::-webkit-scrollbar,
.menu-inner::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

/* Hide PerfectScrollbar (ps) rails & thumbs on sidebar */
.layout-menu .ps__rail-y,
.layout-menu .ps__rail-x,
.layout-menu .ps__thumb-y,
.layout-menu .ps__thumb-x,
#layout-menu .ps__rail-y,
#layout-menu .ps__rail-x,
#layout-menu .ps__thumb-y,
#layout-menu .ps__thumb-x {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  width: 0 !important;
}