/* Smarter IMS brand overrides for Hyper Saas */
:root,
[data-bs-theme='light'] {
  --ct-primary: #1a5f9f;
  --ct-primary-rgb: 26, 95, 159;
  --ct-link-color: #1a5f9f;
  --ct-link-hover-color: #144a7c;
  --ct-menu-item-hover-color: #1a5f9f;
  --ct-menu-item-active-color: #1a5f9f;
}

[data-bs-theme='dark'] {
  --ct-primary: #4a9de0;
  --ct-primary-rgb: 74, 157, 224;
  --ct-link-color: #4a9de0;
  --ct-link-hover-color: #6eb3ea;
}

.btn-primary {
  --ct-btn-bg: var(--ct-primary);
  --ct-btn-border-color: var(--ct-primary);
  --ct-btn-hover-bg: #144a7c;
  --ct-btn-hover-border-color: #144a7c;
  --ct-btn-active-bg: #144a7c;
  --ct-btn-active-border-color: #144a7c;
}

.bg-primary,
.badge.bg-primary,
.text-bg-primary {
  background-color: var(--ct-primary) !important;
}

.text-primary {
  color: var(--ct-primary) !important;
}

.border-primary {
  border-color: var(--ct-primary) !important;
}

/* Hyper component helpers */

.hyper-upload-drag {
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.hyper-upload-drag:hover,
.hyper-upload-drag.is-dragover {
  border-color: var(--ct-primary) !important;
  background-color: rgba(var(--ct-primary-rgb), 0.04) !important;
}

.hyper-upload.is-disabled,
.hyper-upload.is-disabled .hyper-upload-drag {
  opacity: 0.65;
  pointer-events: none;
  cursor: not-allowed;
}

/* Toast / App message host */
.hyper-toast-host {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}

.hyper-toast-host > * {
  pointer-events: auto;
}

/* Simplebar / sidenav scroll comfort — scrollable, scrollbar hidden */
#leftside-menu-container {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE / legacy Edge */
}

#leftside-menu-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.leftside-menu .side-nav {
  padding-bottom: 2rem;
}

.hyper-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}

.hyper-toast-container > * {
  pointer-events: auto;
}

/* Flush sidebar ↔ top bar / content (remove Hyper .75rem content-page gutter) */
.content-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
}

.content-page .app-page-layout {
  flex: 1;
  min-height: 0;
  width: 100%;
}

.content-page .app-page-layout > .footer {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex-shrink: 0;
  height: auto;
  min-height: var(--ct-footer-height, 60px);
}

/* Content modals: override Hyper/Bootstrap default 500px so IMS popups are wide.
   Loads after vendor.min.css / app-saas.min.css via layout <link> order. */
:root {
  --modal-content-width: min(1680px, calc(100vw - 2.5rem));
}

.modal:not(.modal-sm):not(.remittance-view-modal) {
  --bs-modal-width: var(--modal-content-width) !important;
}

.modal:not(.modal-sm):not(.remittance-view-modal) > .modal-dialog {
  width: var(--bs-modal-width, var(--modal-content-width)) !important;
  max-width: var(--bs-modal-width, var(--modal-content-width)) !important;
}

@media (max-width: 991.98px) {
  .modal:not(.modal-sm):not(.remittance-view-modal) > .modal-dialog {
    width: calc(100vw - 1rem) !important;
    max-width: calc(100vw - 1rem) !important;
  }
}
