* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.18); }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(15,23,42,0.32); }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ambient orbs — colors come from app-components vars */
body::before, body::after {
  content: "";
  position: fixed;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
  animation: nc-orb-drift 18s ease-in-out infinite;
}
body::before { background: var(--bg-orb-1); top: -18vw; right: -12vw; }
body::after  { background: var(--bg-orb-2); bottom: -20vw; left: -14vw; animation-delay: -9s; }

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 68px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 10px;
  background: var(--panel-bg);
  border-right: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: width .22s ease, transform .22s ease;
  overflow: hidden;
  z-index: 50;
}
body.sb-open .sidebar { width: 232px; }

.sidebar-logo {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  padding: 8px 6px 14px;
  white-space: nowrap;
  transition: font-size .22s ease;
}
body.sb-open .sidebar-logo { font-size: 1.5rem; }
.sidebar-logo img { width: auto; max-width: 100%; display: none; transition: height .22s ease; }
.sidebar-logo-mark { height: 30px; margin: 0 auto; border-radius: 6px; }
.sidebar-logo-full { height: 60px; }
/* theme-specific swap: dark variant by default, light variant under [data-theme="light"];
   within each theme, mark shows when collapsed and full shows when expanded (sb-open) */
html:not([data-theme="light"]) .sidebar-logo-mark.theme-dark { display: block; }
html:not([data-theme="light"]) body.sb-open .sidebar-logo-mark.theme-dark { display: none; }
html:not([data-theme="light"]) body.sb-open .sidebar-logo-full.theme-dark { display: block; }
html[data-theme="light"] .sidebar-logo-mark.theme-light { display: block; }
html[data-theme="light"] body.sb-open .sidebar-logo-mark.theme-light { display: none; }
html[data-theme="light"] body.sb-open .sidebar-logo-full.theme-light { display: block; }
html:not([data-theme="light"]) body.sb-mobile-open .sidebar-logo-full.theme-dark { display: block; height: 60px; }
html[data-theme="light"] body.sb-mobile-open .sidebar-logo-full.theme-light { display: block; height: 60px; }
body.sb-mobile-open .sidebar-logo-mark { display: none; }
/* combo skin: sidebar frame is dark, so use the dark-theme logo set */
html[data-theme="light"][data-skin="combo"] body .sidebar-logo-mark.theme-light,
html[data-theme="light"][data-skin="combo"] body .sidebar-logo-full.theme-light { display: none; }
html[data-theme="light"][data-skin="combo"] .sidebar-logo-mark.theme-dark { display: block; }
html[data-theme="light"][data-skin="combo"] body.sb-open .sidebar-logo-mark.theme-dark { display: none; }
html[data-theme="light"][data-skin="combo"] body.sb-open .sidebar-logo-full.theme-dark { display: block; }
html[data-theme="light"][data-skin="combo"] body.sb-mobile-open .sidebar-logo-full.theme-dark { display: block; }
/* combo skin: lift the logos off the deep accent frame */
html[data-theme="light"][data-skin="combo"] .sidebar-logo img {
  filter: brightness(1.06) drop-shadow(0 2px 8px rgba(10, 12, 8, 0.55));
}
/* club logo: only in the expanded sidebar, stacked above the ScoutIQ logo;
   collapsed shows just the ScoutIQ mark */
.sidebar-logo-club { display: none; }
body.sb-open .sidebar-logo-club,
body.sb-mobile-open .sidebar-logo-club { display: block; height: 48px; margin: 0 auto 10px; }

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 8px 6px;
  display: flex;
  align-items: center;
}
.sidebar-toggle:hover { color: var(--text); }

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

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.sidebar-link svg { flex: 0 0 auto; }
.sidebar-link span {
  opacity: 0;
  transition: opacity .18s ease;
}
body.sb-open .sidebar-link span { opacity: 1; }
.sidebar-link:hover { color: var(--text); background: var(--panel-inner); }
html[data-theme="light"] .sidebar-link:hover { background: rgba(8,145,178,0.1); color: var(--accent); }
html[data-theme="light"] .sidebar-link.active { background: rgba(8,145,178,0.14); color: var(--accent); }
.sidebar-link.active {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.10);
  box-shadow: inset 2px 0 0 var(--accent);
}
.sidebar-bottom { margin-top: auto; }

/* ---------- main column ---------- */
.shell-main {
  margin-left: 68px;
  transition: margin .22s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.sb-open .shell-main { margin-left: 232px; }

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 40;
}
.topbar-spacer { flex: 1; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-burger { display: none; }

.theme-toggle {
  background: none;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  padding: 5px 7px;
  line-height: 0;
  transition: color .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-faint); }
.theme-icon-sun  { display: none; }
html[data-theme="light"] .theme-icon-moon { display: none; }
html[data-theme="light"] .theme-icon-sun  { display: block; }

.page {
  padding: 24px;
  flex: 1;
}

.sb-backdrop { display: none; }

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); width: 232px; }
  body.sb-mobile-open .sidebar { transform: none; }
  body.sb-mobile-open .sb-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
  }
  .sidebar-link span, .sidebar-logo { opacity: 1; }
  body.sb-mobile-open .sidebar-logo { font-size: 1.5rem; }
  .shell-main, body.sb-open .shell-main { margin-left: 0; }
  .topbar-burger {
    display: inline-flex;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
  }
  .page { padding: 16px; }
}

@media (max-width: 480px) {
  .page { padding: 10px; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar-user .nc-badge { display: none; }
}

.page-flash {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
