/* ==========================================================================
   gym.volrad.eu — Responsive Layout Shell (Desktop Sidebar + Mobile Bottom Nav)
   ========================================================================== */

.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.boot-loader {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-secondary);
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--border-default);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Authenticated Workspace Shell */
.shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Desktop Sidebar */
.sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    padding: 18px 14px;
    z-index: 40;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.nav-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 10px 6px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow-y: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.92rem;
  transition: background 0.14s, color 0.14s;
  min-height: 44px;
}

.nav-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-link svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dev-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--warning);
  background: var(--warning-soft);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  width: fit-content;
}

/* Main Workspace */
.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
}

@media (min-width: 1024px) {
  .workspace {
    margin-left: var(--sidebar-w);
    padding-bottom: 32px;
  }
}

/* Sticky Topbar + Persistent Clickable Breadcrumb Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg-surface) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
}

@media (min-width: 1024px) {
  .topbar {
    padding: 10px 26px;
  }
}

.breadcrumb-nav {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.breadcrumb-nav::-webkit-scrollbar {
  display: none;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  font-size: 0.9rem;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}

.breadcrumbs a:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  text-decoration: none;
}

.breadcrumbs .crumb-sep {
  color: var(--text-muted);
  user-select: none;
  font-size: 0.85rem;
}

.breadcrumbs .crumb-current {
  color: var(--text-primary);
  font-weight: 700;
  padding: 4px 6px;
}

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

/* Page Content Container */
.main-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 14px 28px;
}

@media (min-width: 768px) {
  .main-content {
    padding: 20px 22px 36px;
  }
}

@media (min-width: 1024px) {
  .main-content {
    padding: 24px 28px 40px;
  }
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.page-title {
  font-size: 1.45rem;
  font-weight: 800;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 3px;
}

/* Mobile Fixed Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

@media (min-width: 1024px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 2px;
  min-height: 44px;
}

.bottom-nav-item svg {
  width: 21px;
  height: 21px;
}

.bottom-nav-item.active {
  color: var(--accent);
}

.bottom-nav-item:hover {
  text-decoration: none;
}

/* Responsive Grids */
.schedule-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1120px) {
  .schedule-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Login Full-Screen Layout */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.12), transparent 55%), var(--bg-base);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
}
