/*
 * GroupPilot layout shell: mobile tab bar (< 768px), desktop sidebar (>= 768px).
 * Sources: t2.jsx TabBar, Scr; d2.jsx Side2, DHead.
 */

.gp-shell {
  min-height: 100vh;
}

.gp-main {
  min-width: 0;
  padding: 8px var(--gp-page-x) calc(var(--gp-tabbar-h) + 26px + env(safe-area-inset-bottom));
}

.gp-app--no-nav .gp-main {
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

.gp-main--narrow > .gp-main__inner {
  max-width: var(--gp-content-narrow);
  margin: 0 auto;
}

/* Header row of the four tab pages (↳ Today2): wordmark left, avatar right */
.gp-topbar {
  display: flex;
  align-items: center;
  min-height: 40px;
}

.gp-topbar__end {
  margin-left: auto;
}

/* Sub-page nav row (↳ Attendance2 / Group2): back button + optional right control */
.gp-navrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 calc(var(--gp-nav-x) - var(--gp-page-x));
  padding-top: 4px;
}

.gp-navrow__end {
  margin-left: auto;
}

/* Page header: mobile (↳ Heute/Statistik title) and desktop (↳ DHead) */
.gp-pagehead {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 28px 0 20px;
}

.gp-pagehead__titles {
  flex: 1;
  min-width: 0;
}

.gp-pagehead__eyebrow {
  font-size: 15px;
  color: var(--gp-ink2);
  margin-bottom: 4px;
}

.gp-pagehead__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ------------------------------------------------------------------ tab bar */
.gp-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  height: calc(var(--gp-tabbar-h) + env(safe-area-inset-bottom));
  padding: 8px 8px env(safe-area-inset-bottom);
  background: var(--gp-bg);
  border-top: 1px solid var(--gp-line);
}

@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .gp-tabbar {
    background: var(--gp-dock);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
  }
}

.gp-tabbar__list {
  display: flex;
  flex: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gp-tabbar__item {
  flex: 1;
}

.gp-tabbar__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 48px;
  color: var(--gp-ink3);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}

.gp-tabbar__link[aria-current="page"] {
  color: var(--gp-ink);
  font-weight: 600;
}

/*
 * Phone and desktop views of one page (ADR-007), switched at the shell breakpoint. Hide-only: the
 * element keeps its own display value in the view where it is shown.
 */
@media (max-width: 767.98px) {
  .gp-view-desktop {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .gp-view-mobile {
    display: none !important;
  }
}

/* ------------------------------------------------------------------ sidebar */
.gp-sidebar {
  display: none;
}

@media (min-width: 768px) {
  .gp-shell {
    display: flex;
  }

  .gp-tabbar {
    display: none;
  }

  .gp-main,
  .gp-app--no-nav .gp-main {
    flex: 1;
    padding: 28px 32px 40px;
  }

  .gp-app--no-nav .gp-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .gp-topbar {
    display: none;
  }

  .gp-pagehead {
    margin: 0 0 24px;
  }

  .gp-pagehead__eyebrow {
    font-size: 14px;
  }

  .gp-pagehead .gp-t-xl,
  .gp-pagehead .gp-t-l {
    font-size: 36px;
    letter-spacing: -1.5px;
    line-height: 1.05;
  }

  .gp-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: var(--gp-sidebar-w);
    height: 100vh;
    padding: 22px 14px;
    border-right: 1px solid var(--gp-line);
  }

  .gp-sidebar__brand {
    padding: 0 8px 26px;
  }

  .gp-sidebar__nav {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .gp-sidebar__link,
  .gp-sidebar__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--gp-r-btn-desk);
    background: transparent;
    color: var(--gp-ink2);
    font-size: 14.5px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  .gp-sidebar__link:hover,
  .gp-sidebar__toggle:hover {
    color: var(--gp-ink);
  }

  .gp-sidebar__link[aria-current="page"],
  .gp-sidebar__toggle[data-active="true"] {
    background: var(--gp-sunken);
    color: var(--gp-ink);
    font-weight: 600;
  }

  .gp-sidebar__chevron {
    margin-left: auto;
    transition: transform .2s;
  }

  .gp-sidebar__toggle[aria-expanded="true"] .gp-sidebar__chevron {
    transform: rotate(180deg);
  }

  .gp-sidebar__sub {
    margin: 2px 0 4px;
    padding: 0;
    list-style: none;
  }

  .gp-sidebar__sub[hidden] {
    display: none;
  }

  .gp-sidebar__sub .gp-sidebar__link {
    height: 36px;
    padding-left: 42px;
    font-size: 14px;
  }

  .gp-sidebar__user {
    position: relative;
    margin-top: auto;
    border-top: 1px solid var(--gp-line);
    padding-top: 4px;
  }
}

/* Pages with their own dock instead of the tab bar (attendance) */
.gp-app--no-tabbar .gp-main {
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}
