/* AgendaFlow — Menu lateral SOMENTE no PWA instalado em telas até 900px. */
.af-pwa-menu-toggle,
.af-pwa-menu-backdrop,
.af-pwa-menu-heading,
.af-pwa-schedules-current { display: none !important; }

body.af-pwa-mobile-menu .af-pwa-menu-toggle[hidden],
body.af-pwa-mobile-menu .af-pwa-menu-backdrop[hidden],
body.af-pwa-mobile-menu .af-pwa-drawer [hidden] { display: none !important; }

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

  body.af-pwa-mobile-menu .app-shell .topbar {
    align-items: flex-start;
    justify-content: space-between;
  }
  body.af-pwa-mobile-menu .app-shell .topbar > div:first-child {
    min-width: 0;
    flex: 1;
  }
  body.af-pwa-mobile-menu .client-header {
    align-items: center;
    justify-content: space-between;
  }

  body.af-pwa-mobile-menu .af-pwa-menu-toggle:not([hidden]) {
    width: 48px;
    height: 48px;
    padding: 12px;
    border: 1px solid rgba(214, 179, 106, .48);
    border-radius: 14px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 0 0 48px;
    color: var(--accent-2, #f3d696);
    background: rgba(214, 179, 106, .09);
    cursor: pointer;
  }
  body.af-pwa-mobile-menu .af-pwa-menu-toggle > span {
    width: 21px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
  }
  body.af-pwa-mobile-menu .af-pwa-menu-toggle:focus-visible,
  body.af-pwa-mobile-menu .af-pwa-drawer a:focus-visible,
  body.af-pwa-mobile-menu .af-pwa-drawer button:focus-visible {
    outline: 2px solid var(--accent, #d6b36a);
    outline-offset: 3px;
  }

  body.af-pwa-mobile-menu .af-pwa-menu-backdrop:not([hidden]) {
    display: block !important;
    position: fixed;
    z-index: 3000;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: rgba(0, 0, 0, .66);
    backdrop-filter: blur(3px);
    cursor: pointer;
  }

  body.af-pwa-mobile-menu .af-pwa-drawer {
    box-sizing: border-box;
    position: fixed !important;
    z-index: 3001;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 88vw);
    max-width: 100%;
    height: 100%;
    height: 100dvh;
    padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-left: 1px solid rgba(214, 179, 106, .29);
    background: linear-gradient(160deg, #172230 0%, #0e141c 55%, #0a0e14 100%);
    box-shadow: -14px 0 48px rgba(0,0,0,.5);
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .25s ease, visibility .25s;
  }

  body.af-pwa-mobile-menu.af-pwa-menu-open .af-pwa-drawer {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  body.af-pwa-mobile-menu .af-pwa-menu-heading {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px 0 17px;
    border-bottom: 1px solid rgba(214, 179, 106, .24);
    color: #f0d497;
    font-size: 19px;
    font-weight: 800;
  }
  body.af-pwa-mobile-menu .af-pwa-menu-close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 12px;
    border: 1px solid #3a4653;
    color: #fff;
    background: #1c2732;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
  }

  body.af-pwa-mobile-menu .af-pwa-drawer > a:not([hidden]),
  body.af-pwa-mobile-menu .af-pwa-drawer > button:not([hidden]):not(.af-pwa-menu-close) {
    box-sizing: border-box;
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 51px;
    margin: 0;
    padding: 13px 15px !important;
    text-align: left;
    text-decoration: none;
    font: 700 15px/1.4 system-ui, sans-serif !important;
    letter-spacing: normal;
    color: #f5f6f8 !important;
    background: #1b2632;
    border: 1px solid #354453;
    border-radius: 13px;
    box-shadow: none;
    white-space: normal;
    cursor: pointer;
  }
  body.af-pwa-mobile-menu .af-pwa-drawer > .af-admin-button:not([hidden]) {
    color: #f1cf84 !important;
    border-color: rgba(214,179,106,.45);
    background: rgba(214,179,106,.11);
  }
  body.af-pwa-mobile-menu .af-pwa-drawer .admin-entry::after { content: none !important; display: none !important; }
  body.af-pwa-mobile-menu .af-pwa-drawer > .logout-entry:not([hidden]),
  body.af-pwa-mobile-menu .af-pwa-drawer > #clientLogout:not([hidden]) {
    color: #ffb6b6 !important;
    border-color: rgba(255,130,130,.30);
    background: rgba(255,100,100,.07);
    margin-top: 8px;
  }
  body.af-pwa-mobile-menu .af-pwa-drawer > .user-chip {
    display: block !important;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
    padding: 11px 13px;
    white-space: normal;
    overflow-wrap: anywhere;
    color: #bac7d5;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
  }
  body.af-pwa-mobile-menu .af-pwa-drawer > .af-pwa-schedules-current {
    display: flex !important;
    color: #f1cf84 !important;
  }
  body.af-pwa-mobile-menu .af-pwa-drawer > .af-pwa-schedules-current[aria-current="page"] {
    border-color: rgba(214,179,106,.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.af-pwa-mobile-menu .af-pwa-drawer { transition: none; }
}
