.isDisabled {
  color: currentColor;
  cursor: not-allowed;
  opacity: 0.5;
  text-decoration: none;
}

/* ================================================================
   MOBILE RESPONSIVE FIXES
   ================================================================ */

/* ── Mobile sidebar overlay backdrop ── */
#sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.5);
  z-index: 1040;
  opacity: 0;
  transition: opacity .25s ease;
}
#sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ── Mobile sidebar close button ── */
.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 10;
  transition: background .2s;
  align-items: center;
  justify-content: center;
}
.sidebar-close-btn:hover {
  background: rgba(255,255,255,.25);
}

/* ── Scrollable table wrappers ── */
.table-responsive,
.table-wrapper {
  -webkit-overflow-scrolling: touch;
}

/* ================================================================
   BREAKPOINT: < 768px (mobile)
   ================================================================ */
@media (max-width: 767.98px) {

  /* ── Prevent horizontal overflow on mobile ── */
  html, body { overflow-x: hidden !important; max-width: 100vw !important; }
  .page { max-width: 100vw !important; overflow-x: hidden !important; }
  .os-resize-observer-host { max-width: 100% !important; overflow: hidden !important; }

  /* ── Dashboard welcome tabs: stack vertically on mobile ── */
  .nav-tabs, .nav-pills { flex-direction: column !important; }
  .nav-tabs .nav-item, .nav-pills .nav-item { width: 100%; }
  .nav-tabs .nav-link, .nav-pills .nav-link { text-align: left; padding: 10px 16px; border-radius: 0 !important; }

  /* ── AI builder / parking admin mobile fixes ── */
  .page .container-fluid { padding-left: 10px !important; padding-right: 10px !important; }
  table { display: block; overflow-x: auto; max-width: 100%; }
  pre, code { white-space: pre-wrap; word-break: break-all; }
  .modal-dialog { margin: 5px !important; max-width: calc(100vw - 10px) !important; }
  .modal-body { padding: 10px !important; }
  textarea, input[type="text"], select { max-width: 100% !important; }

  /* ── Sidebar: full-width drawer from left ── */
  .side-navbar {
    width: min(300px, 85vw) !important;
    left: calc(-1 * min(310px, 86vw)) !important;
    z-index: 1050 !important;
    text-align: left !important;
    transition: left .3s ease !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }
  .side-navbar.show-sm {
    left: 0 !important;
  }
  /* Sidebar header: compact logo + close button */
  .side-navbar .sidenav-header-inner {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 12px !important;
  }
  .side-navbar .sidenav-header-inner img {
    max-height: 30px !important;
    width: auto !important;
  }
  .side-navbar .sidenav-header-inner h2,
  .side-navbar .sidenav-header-inner .h2 {
    font-size: 12px !important;
    margin: 0 !important;
  }
  .side-navbar .sidenav-header-inner span,
  .side-navbar .sidenav-header-inner small,
  .side-navbar .sidenav-header-inner p {
    font-size: 10px !important;
  }
  .side-navbar .brand-small {
    display: none !important;
  }
  .sidebar-close-btn {
    display: flex !important;
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    z-index: 10 !important;
    background: rgba(255,255,255,0.15) !important;
    border: none !important;
    color: #fff !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    cursor: pointer !important;
  }
  .side-navbar .sidenav-header {
    position: relative !important;
    padding: 8px !important;
  }

  /* Sidebar menu items: larger touch targets */
  .side-navbar .sidebar-link {
    flex-direction: row !important;
    padding: 12px 16px !important;
    font-size: 0.88rem !important;
    min-height: 44px;
    align-items: center;
  }
  .side-navbar .sidebar-link svg,
  .side-navbar .sidebar-link i {
    margin-right: 10px !important;
    flex-shrink: 0;
  }
  .side-navbar .sidebar-item li a {
    padding-left: 2.2rem !important;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  /* Category headings: very compact on mobile */
  .side-navbar .heading {
    margin: 4px 6px 2px !important;
    font-size: 9px !important;
    padding: 3px 10px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.03em;
    line-height: 1.2 !important;
  }
  /* Sidebar section groups: tighter spacing */
  .side-navbar .sidebar-group { margin-bottom: 2px !important; }
  .side-navbar .sidebar-group-items { padding-bottom: 0 !important; }
  /* Sidebar menu item text: prevent overflow */
  .side-navbar .sidebar-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* More padding between sidebar items for easier tapping */
  .side-navbar .sidebar-item {
    margin-bottom: 2px;
  }
  /* Mobile-only items visible */
  .side-navbar .mobile-only {
    display: block !important;
  }

  /* ── Page content: full width on mobile ── */
  .page {
    width: 100% !important;
    position: relative !important;
  }
  .page.active,
  .page.active-sm {
    width: 100% !important;
  }

  /* ── Header navbar: compact layout ── */
  nav.navbar {
    padding: 0.5rem 0 !important;
  }
  nav.navbar .container-fluid {
    padding: 0 10px !important;
  }
  nav.navbar .d-flex.align-items-center.justify-content-between {
    flex-wrap: nowrap;
    gap: 4px;
  }

  /* Hamburger button: always visible, larger touch target */
  .menu-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Brand text: hide on small mobile */
  .brand-text {
    display: none !important;
  }

  /* Nav menu: compact row */
  .nav-menu {
    flex-wrap: nowrap !important;
    gap: 2px !important;
    align-items: center !important;
  }
  .nav-menu .nav-link {
    padding: 6px 8px !important;
    font-size: 0.8rem !important;
  }
  .nav-menu .nav-item {
    flex-shrink: 0;
  }

  /* Domain selector: hide entirely on mobile — use sidebar instead */
  .domain-selector-wrap {
    display: none !important;
  }

  /* Profile photo / welcome card: compact on mobile */
  .db-welcome-avatar--photo {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    object-fit: cover;
    border-radius: 50% !important;
  }
  .db-welcome-avatar:not(.db-welcome-avatar--photo) {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    font-size: 1rem !important;
    line-height: 40px !important;
  }
  .db-welcome-header {
    display: none !important;
  }
  .db-welcome-card {
    position: static !important;
    margin-bottom: 1rem;
  }

  /* Language selector: compact (small flag, no text) */
  #languages {
    padding: 6px 8px !important;
  }
  #languages span,
  #languages .d-none {
    display: none !important;
  }
  #languages img {
    margin: 0 !important;
  }
  /* Hide language text in dropdown items - keep flag */
  .nav-item.dropdown .dropdown-item span {
    /* keep visible - dropdown is a popup so text helps */
  }

  /* Messages: icon only on mobile */
  #sysmsg-count-text {
    display: none !important;
  }

  /* Theme & MyAccount: hidden (moved to sidebar mobile-only items) */
  .mobile-hide {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }

  /* Shopping cart in header: icon only */
  .showcard i + i {
    display: none;
  }
  .showcard span {
    display: none;
  }

  /* Subclient/admin info text: hide on mobile */
  .nav-item > span.nav-link.text-white.text-sm {
    display: none !important;
  }

  /* ── Content area: mobile-friendly ── */
  section.py-5 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
  .container-fluid {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Tables: horizontal scroll */
  .table-responsive,
  .card-body > .table,
  .table-wrapper,
  table.table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Cards: single column stack */
  .row > [class*="col-lg-"],
  .row > [class*="col-xl-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Form inputs: full width */
  .form-control,
  .form-select,
  select.form-control {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Font sizes: slightly larger for readability */
  body {
    font-size: 0.95rem;
  }

  /* Dropdown menus: wider on mobile */
  .dropdown-menu {
    min-width: auto !important;
  }
  .sysmsg-dropdown {
    min-width: 280px !important;
    max-width: 95vw !important;
  }
}

/* ================================================================
   BREAKPOINT: < 576px (extra small)
   ================================================================ */
@media (max-width: 575.98px) {

  /* Modal: near full-screen on very small screens */
  .modal-dialog {
    margin: 0.5rem !important;
    max-width: calc(100vw - 1rem) !important;
  }
  .modal-dialog-centered {
    min-height: calc(100vh - 1rem) !important;
  }

  /* Domain selector already hidden at 768px breakpoint */

  /* Even more compact navbar padding */
  nav.navbar .container-fluid {
    padding: 0 6px !important;
  }

  /* Sidebar width already set at 768px breakpoint */
}

/* ================================================================
   BREAKPOINT: < 992px (tablet portrait)
   ================================================================ */
@media (max-width: 991.98px) {

  /* Side navbar: ensure it works as a drawer on tablets too */
  .side-navbar .sidebar-link {
    flex-direction: row !important;
    font-size: 0.85rem !important;
  }

  /* Content padding: reduce on tablet */
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Mobile-only items */
  .mobile-only {
    display: block !important;
  }
  .mobile-hide {
    display: none !important;
  }
}

/* ================================================================
   Account subnav: horizontal scroll on mobile
   ================================================================ */
@media (max-width: 767.98px) {
  .account-subnav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 8px;
  }
  .account-subnav-inner {
    flex-wrap: nowrap !important;
    min-width: max-content;
  }
  .account-subnav-link,
  .account-subnav-home {
    padding: 8px 12px !important;
    font-size: .78rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
  }
  /* Hide scrollbar but keep functionality */
  .account-subnav::-webkit-scrollbar {
    height: 3px;
  }
  .account-subnav::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.15);
    border-radius: 3px;
  }
  .account-subnav::-webkit-scrollbar-track {
    background: transparent;
  }
}

/* ================================================================
   PWA install banner: mobile-friendly layout
   ================================================================ */
@media (max-width: 575.98px) {
  #pwa-install-banner {
    flex-direction: column !important;
    text-align: center;
    gap: 10px;
    padding: 12px 16px !important;
  }
}
