/* css/mobile-sidebar.css */

@media (max-width: 768px) {

  :root {
    --sidebar-w: 252px !important;
    --sidebar-offset: 48px;
  }

  /* SIDEBAR */
  #sidebar {
    position: fixed;
    top: calc(var(--topbar-h) + var(--goalbar-h));
    left: 0;
    bottom: 0;

    width: var(--sidebar-w);
    transform: translateX(calc(48px - var(--sidebar-w)));
    transition: transform .25s ease;

    overflow-y: auto;
    overflow-x: hidden;

    padding-bottom: 88px;
    background: #F7F9FC;
    z-index: 300;
  }

  body.sidebar-open #sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 18px rgba(0,0,0,.25);
  }

  /* OVERLAY */
  #sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 280;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  body.sidebar-open #sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  /* NAV ITEMS */
  #sidebar .nav-item {
    position: relative;
    white-space: normal;
    padding-right: 48px;
    align-items: flex-start;
  }

  #sidebar .nav-dot {
    position: absolute;
    right: 20px;
    top: 0.9rem;
  }

  #sidebar .nav-item > :not(.nav-dot) {
    position: absolute;
    left: 60px;
    opacity: 0;
    pointer-events: none;
    max-width: calc(var(--sidebar-w) - 96px);
  }

  body.sidebar-open #sidebar .nav-item > :not(.nav-dot) {
    position: static;
    opacity: 1;
    pointer-events: auto;
    max-width: none;
  }

  /* SECTION HEADERS */
  #sidebar .nav-section {
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
  }

  body.sidebar-open #sidebar .nav-section {
    opacity: 1;
    pointer-events: auto;
  }

  /* MAIN */
  #main {
    padding-left: 48px;
    margin-left: 0 !important;
  }

  /* FAB BUTTON – LEFT BOTTOM */
  #sidebar-fab {
    position: fixed;
    left: 1rem;
    bottom: 1.1rem;

    width: 52px;
    height: 52px;
    border-radius: 50%;

    background: var(--ce-blue);
    color: #fff;
    border: none;

    font-family: var(--font-ui);
    font-size: 1.35rem;
    font-weight: 700;

    box-shadow: 0 6px 18px rgba(0,0,0,.25);
    cursor: pointer;
    z-index: 400;
  }

  body.sidebar-open #sidebar-fab {
    display: none;
  }
}


/* Mobile: stack label + select */
@media (max-width: 768px) {
  .match-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .match-sel {
    width: 100%;
    min-width: 0;
  }
}
