/* =========================================================
   STUDY — Architecture & Navigation Responsive (iOS & Desktop)
   ========================================================= */

.app-shell {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Main Content Area */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 18px calc(108px + var(--safe-bottom));
}

.view {
  display: none;
  animation: viewFadeIn 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.view.active {
  display: block;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Top Bar Mobile / Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  display: grid;
  place-items: center;
  color: var(--orange);
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-date {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.view-title {
  margin: 0;
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.view-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* =========================================================
   MOBILE FLOATING TAB BAR (Fidèle à la capture Encore)
   ========================================================= */

.bottom-nav-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 90;
  display: flex;
  justify-content: center;
  padding: 0 14px;
  pointer-events: none;
}

.bottom-nav {
  pointer-events: auto;
  width: min(460px, 100%);
  padding: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-glass);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: var(--shadow-float);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.tab-btn {
  border: 0;
  background: transparent;
  border-radius: var(--radius-pill);
  padding: 8px 4px;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 120ms ease;
}

.tab-btn:active {
  transform: scale(0.96);
}

.tab-btn svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-btn span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tab-btn.active {
  background: var(--surface-secondary);
  color: var(--orange);
}

/* =========================================================
   DESKTOP SIDEBAR NAVIGATION (>= 860px)
   ========================================================= */

.desktop-sidebar {
  display: none;
}

@media (min-width: 860px) {
  .app-shell {
    flex-direction: row;
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 24px;
    gap: 24px;
  }

  .bottom-nav-wrap {
    display: none;
  }

  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    width: 236px;
    min-height: calc(100dvh - 40px);
    padding: 20px 14px;
    border-radius: var(--radius-xl);
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 20px;
    border-bottom: 1px solid var(--border-faint);
    margin-bottom: 16px;
  }

  .sidebar-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--bg-pure);
    border: 1px solid var(--border-subtle);
    display: grid;
    place-items: center;
    color: var(--orange);
  }

  .sidebar-title {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  .sidebar-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .sidebar-btn {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background-color 160ms ease, color 160ms ease;
  }

  .sidebar-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
  }

  .sidebar-btn:hover {
    background: var(--surface-secondary);
    color: var(--text-primary);
  }

  .sidebar-btn.active {
    background: var(--orange-soft);
    color: var(--orange);
  }

  .sidebar-divider {
    height: 1px;
    background: var(--border-faint);
    margin: 12px 8px;
  }

  .sidebar-spacer {
    flex: 1;
  }

  .sidebar-footer {
    padding-top: 12px;
    border-top: 1px solid var(--border-faint);
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .app-main {
    padding: 6px 4px 40px;
    max-width: none;
    min-width: 0;
  }
}
