/* Plataforma Control Facility V11.39 · navegación móvil utilizable */
.cf-mobile-menu-toggle,
.cf-mobile-menu-backdrop {
  display: none;
}

@media (max-width: 900px) {
  body.cf-mobile-menu-open {
    overflow: hidden !important;
  }

  .cf-mobile-menu-toggle {
    position: fixed;
    top: 9px;
    left: 10px;
    z-index: 10040;
    display: inline-flex;
    min-width: 98px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.84) !important;
    border-radius: 10px;
    background: linear-gradient(135deg, #08a9c9, #087b9c) !important;
    box-shadow: 0 7px 18px rgba(7, 83, 109, 0.24) !important;
    color: #ffffff !important;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.025em;
  }

  .cf-mobile-menu-toggle:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.72) !important;
    outline-offset: 2px;
  }

  body.cf-mobile-menu-open .cf-mobile-menu-toggle {
    left: min(calc(86vw - 56px), 284px);
    width: 44px;
    min-width: 44px;
    padding-inline: 0;
    font-size: 0;
  }

  body.cf-mobile-menu-open .cf-mobile-menu-toggle::before {
    content: "×";
    font-size: 1.55rem;
    font-weight: 650;
    line-height: 1;
  }

  .cf-mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10010;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: rgba(4, 38, 51, 0.52) !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.cf-mobile-menu-open .cf-mobile-menu-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 10020 !important;
    display: flex !important;
    width: min(86vw, 340px) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 20px 18px 24px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: translateX(-105%);
    transition: transform 0.22s ease !important;
    visibility: hidden;
    box-shadow: 12px 0 34px rgba(4, 38, 51, 0.3) !important;
  }

  body.cf-mobile-menu-open .sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .main {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    padding: 0 12px 28px !important;
  }

  .top-strip {
    min-height: 60px !important;
    margin-inline: -12px !important;
    padding: 9px 14px 9px 118px !important;
    justify-content: flex-end !important;
  }

  .top-strip > span {
    display: none !important;
  }

  .top-strip > b {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.72rem !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar .brand {
    min-height: 68px !important;
    justify-content: flex-start !important;
    gap: 13px !important;
    padding: 0 52px 18px 4px !important;
    text-align: left !important;
  }

  .sidebar .brandmark {
    flex: 0 0 58px !important;
    width: 58px !important;
    height: 56px !important;
  }

  .sidebar .brand strong {
    display: block !important;
    font-size: 0.77rem !important;
  }

  .sidebar .brand span {
    display: block !important;
    font-size: 0.67rem !important;
  }

  .sidebar .site-switch {
    padding: 13px !important;
  }

  .sidebar nav > button,
  .sidebar nav .cf-nav-group-title,
  .sidebar nav .cf-nav-option,
  .sidebar-foot button,
  .sidebar > #facilityLogout {
    min-height: 44px !important;
    padding: 10px 12px !important;
    font-size: 0.84rem !important;
    line-height: 1.25 !important;
    text-align: left !important;
    white-space: normal !important;
  }

  .sidebar nav .cf-nav-group-title {
    justify-content: space-between !important;
  }

  .sidebar nav .cf-nav-group-title b {
    display: block !important;
  }

  .sidebar nav .cf-nav-option {
    padding-left: 16px !important;
    font-size: 0.8rem !important;
  }

  .cf-nav-group-options {
    padding-left: 8px !important;
  }

  main > header,
  main:not(.cf-dashboard-view) > header,
  main.cf-dashboard-view > header {
    margin-top: 12px !important;
  }

  .table-wrap,
  .cf-execution-table-wrap {
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 520px) {
  .main {
    padding-inline: 9px !important;
  }

  .top-strip {
    margin-inline: -9px !important;
  }

  main:not(.cf-dashboard-view) > header,
  main.cf-dashboard-view > header {
    padding: 14px !important;
  }

  .panel,
  .page-panel,
  .modal {
    padding: 15px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .cf-mobile-menu-backdrop {
    transition: none !important;
  }
}
