/* Mobile-only responsive layer.
   Loaded after app.css/theme.css to keep desktop styles unchanged. */

@media (min-width: 901px) {
  .tb-nav-toggle {
    display: none;
  }
}

@media (max-width: 900px) {
  .tb-topbar .tb-shell {
    position: relative;
    gap: 12px;
  }

  .tb-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(var(--tb-brand-rgb, 0, 127, 133), .38);
    border-radius: 10px;
    background: #fff;
    color: var(--tb-brand);
    cursor: pointer;
    flex: 0 0 auto;
  }

  .tb-nav-toggle:hover {
    background: rgba(var(--tb-brand-rgb, 0, 127, 133), .08);
  }

  .tb-nav-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--tb-brand-rgb, 0, 127, 133), .2);
  }

  .tb-nav {
    display: none !important;
    position: absolute;
    top: calc(100% + 10px);
    left: 16px;
    right: 16px;
    z-index: 70;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(2, 6, 23, .18);
    max-height: none;
    overflow: visible;
  }

  .tb-nav.is-open {
    display: flex !important;
  }

  .tb-nav-link {
    width: 100%;
    min-height: 44px;
    justify-content: space-between;
    font-size: .95rem;
  }

  .tb-nav-dd {
    width: 100%;
  }

  .tb-nav-dd-menu {
    position: static;
    top: auto;
    left: auto;
    width: 100%;
    min-width: 0;
    margin-top: 6px;
    box-shadow: none;
    border-radius: 10px;
    overflow: hidden;
  }

  .tb-nav-dd-item {
    grid-template-columns: 1fr;
  }

  .tb-nav-dd-hint {
    justify-self: start;
    text-align: left;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .tb-shell.py-8 {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .tb-dashboard-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    align-items: stretch;
  }

  .tb-dashboard-toolbar > *,
  .tb-dashboard-toolbar .tb-action-dd,
  .tb-dashboard-toolbar .tb-layout-dd {
    width: 100%;
    min-width: 0;
  }

  .tb-dashboard-toolbar .btn,
  .tb-dashboard-toolbar .btn-outline,
  .tb-dashboard-toolbar .tb-layout-dd-summary,
  .tb-dashboard-toolbar .tb-action-dd > summary {
    width: 100% !important;
    justify-content: center;
    gap: 6px;
    padding-inline: 10px !important;
  }

  .tb-dashboard-toolbar .tb-icon-btn {
    width: 100%;
  }

  .tb-dashboard-toolbar .tb-icon-btn::after {
    content: attr(aria-label);
    font-weight: 700;
    font-size: .92rem;
    margin-left: 8px;
  }

  .tb-toolbar-current {
    font-size: .76rem;
  }

  #dashboardLayoutCurrentIcon {
    width: 30px;
    height: 20px;
    flex-basis: 30px;
  }

  .tb-dashboard-toolbar .tb-layout-dd-menu,
  .tb-dashboard-toolbar .tb-filter-dd-menu,
  .tb-dashboard-toolbar .tb-action-dd-menu {
    left: 0;
    right: auto;
    width: min(88vw, 340px);
    min-width: 260px;
    max-width: calc(100vw - 32px);
  }

  .fc .fc-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .fc .fc-toolbar-chunk {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .fc .fc-button-group {
    display: flex;
    width: 100%;
  }

  .fc .fc-button-group > .fc-button {
    flex: 1 1 auto;
  }

  .fc .fc-toolbar-title {
    font-size: 1.15rem;
    line-height: 1.2;
  }

  #custBookingActions.tb-cust-booking-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  #custBookingActions.tb-cust-booking-actions .tb-cust-booking-btn {
    width: 100% !important;
    min-height: 44px;
    padding-inline: 14px !important;
  }

  .tb-cust-top-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    align-items: stretch;
  }

  .tb-cust-top-actions .tb-cust-top-btn {
    width: 100% !important;
    min-height: 44px;
    justify-content: center;
  }

  .tb-cust-inline-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    align-items: stretch;
  }

  .tb-cust-inline-actions .tb-cust-inline-btn {
    width: 100% !important;
    min-height: 44px;
    justify-content: center;
  }

  .tb-cust-form-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .tb-cust-form-actions .tb-cust-form-btn {
    width: 100% !important;
    min-height: 44px;
  }
}
