/* App shell: fixed header, optional sidebar, scrolling main. */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: 0 var(--s4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand span { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: var(--s1);
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  padding: var(--s2) var(--s3);
  border-radius: var(--radius);
  color: var(--text-dim);
  white-space: nowrap;
  font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-dim); color: var(--text); }

.user-chip {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s1) var(--s2);
  border-radius: var(--radius);
  color: var(--text-dim);
}
.user-chip img { width: 24px; height: 24px; border-radius: 50%; }

main {
  padding: var(--s5);
  max-width: 1600px;
  margin: 0 auto;
}
main.narrow { max-width: 900px; }

.page-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);
  margin-bottom: var(--s5);
  flex-wrap: wrap;
}
.page-head h1 { margin: 0; }
.page-head .subtitle { color: var(--text-dim); margin: var(--s1) 0 0; }
.page-actions { margin-left: auto; display: flex; gap: var(--s2); flex-wrap: wrap; }

.grid { display: grid; gap: var(--s4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Officer screens: a working area plus a persistent side panel
   (the unassigned pool, filters, or a detail inspector). */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--s4);
  align-items: start;
}
.split > aside {
  position: sticky;
  top: calc(var(--header-h) + var(--s5));
  max-height: calc(100vh - var(--header-h) - var(--s6));
  overflow-y: auto;
}

/* Desktop-first, but the member-facing board page gets used on a phone
   between fights, so it has to survive a narrow viewport. */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > aside { position: static; max-height: none; }
}

@media (max-width: 720px) {
  main { padding: var(--s3); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .app-header { gap: var(--s2); padding: 0 var(--s3); }
}

/* Centred single-purpose pages (login). */
.centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--s4);
}

.empty-state {
  padding: var(--s7) var(--s4);
  text-align: center;
  color: var(--text-dim);
}
.empty-state h1, .empty-state h2 { color: var(--text); }
