/* Shared roster-aligned shell for customer-facing secondary pages. */
* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body.roster-page {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0;
  transition: background 0.25s ease, color 0.25s ease;
}

body.roster-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.rp-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 110px;
}

.rp-topbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.rp-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 750;
  text-decoration: none;
}

.rp-brand-mark,
.rp-title-icon,
.rp-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--surface2);
  color: var(--accent);
  border: 1px solid var(--border);
}

.rp-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.rp-top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.rp-nav-link,
.rp-icon-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.86rem;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.rp-nav-link { padding: 0 13px; }
.rp-icon-btn { width: 42px; padding: 0; }
.rp-nav-link:hover,
.rp-icon-btn:hover {
  color: var(--text);
  background: var(--surface2);
}
.rp-nav-link:active,
.rp-icon-btn:active { transform: scale(0.96); }

.rp-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 26px 0 24px;
}

.rp-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.rp-title-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.rp-title-icon svg { width: 25px; height: 25px; }

.rp-title {
  margin: 0;
  color: var(--text);
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 850;
}

.rp-subtitle {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.rp-segmented {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.rp-segment {
  min-height: 40px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.rp-segment:hover { color: var(--text); }
.rp-segment.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow);
}

.rp-list-header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 116px;
  gap: 12px;
  padding: 0 16px 9px;
  color: var(--text-dim);
  font-size: 0.72rem;
}
.rp-list-header span:first-child { text-align: center; }
.rp-list-header span:last-child { text-align: right; }

.rp-stack { display: grid; gap: 10px; }

.rp-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.rp-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.rp-empty {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.rp-empty svg { width: 34px; height: 34px; color: var(--text-dim); }

.rp-loading {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
}
.rp-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: rpSpin 0.75s linear infinite;
}
@keyframes rpSpin { to { transform: rotate(360deg); } }

.rp-bottom-tab-bar {
  display: none;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 800;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.rp-bottom-tab-bar .tab-list {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.rp-bottom-tab-bar .bottom-tab-item {
  min-width: 52px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 550;
  text-decoration: none;
}
.rp-bottom-tab-bar .bottom-tab-item svg { width: 19px; height: 19px; }
.rp-bottom-tab-bar .bottom-tab-item.active {
  color: var(--accent);
  background: var(--accent-glow);
}
.rp-bottom-tab-bar .bottom-tab-center { position: relative; }
.rp-bottom-tab-bar .center-avatar {
  width: 44px;
  height: 44px;
  margin-top: -18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow), var(--shadow);
}
.rp-bottom-tab-bar .center-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.theme-float { display: none; }
.theme-dropdown { position: relative; }

@media (max-width: 768px) {
  .rp-shell {
    width: 100%;
    padding: 12px 12px 104px;
  }
  .rp-topbar {
    min-height: 50px;
    margin-bottom: 14px;
  }
  .rp-top-actions .rp-nav-link,
  .rp-top-actions .theme-dropdown { display: none; }
  .rp-title-row {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    margin: 18px 0;
  }
  .rp-title-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }
  .rp-title { font-size: 1.45rem; }
  .rp-segmented { width: 100%; }
  .rp-segment { flex: 1; padding: 0 8px; }
  .rp-bottom-tab-bar { display: block; }
  .theme-float {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    right: 12px;
    left: auto;
    z-index: 9999;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: var(--surface);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
