:root {
  --bg: #eef2f4;
  --paper: rgba(255, 255, 255, 0.94);
  --paper-strong: #ffffff;
  --ink: #151b1c;
  --line: rgba(21, 27, 28, 0.1);
  --brand: #171d1d;
  --brand-2: #f6c316;
  --brand-3: #54b8e5;
  --brand-4: #e44a32;
  --warning: #ca8a1d;
  --danger: #cf4b36;
  --shadow: 0 20px 45px rgba(17, 22, 24, 0.09);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Barlow", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(246, 195, 22, 0.18), transparent 24%),
    radial-gradient(circle at bottom right, rgba(84, 184, 229, 0.18), transparent 26%),
    linear-gradient(180deg, #f8fafb 0%, #ebf1f4 100%);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.menu-toggle-button {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  background: linear-gradient(180deg, rgba(20, 25, 26, 0.98), rgba(17, 22, 23, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  padding: 8px;
  gap: 5px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.menu-toggle-button span {
  display: block;
  width: 24px;
  height: 2px;
  background: #f3f6f8;
  transition: all 300ms ease;
  border-radius: 1px;
}

.menu-toggle-button.open span:nth-child(1) {
  transform: rotate(45deg) translateY(12px);
}

.menu-toggle-button.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle-button.open span:nth-child(3) {
  transform: rotate(-45deg) translateY(-12px);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 998;
  transition: background 300ms ease;
}

.sidebar-overlay.open {
  background: rgba(0, 0, 0, 0.5);
  display: block;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px 22px;
  background:
    linear-gradient(180deg, rgba(20, 25, 26, 0.98), rgba(17, 22, 23, 0.98)),
    linear-gradient(180deg, rgba(84, 184, 229, 0.1), rgba(0, 0, 0, 0));
  color: #f3f6f8;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.18));
}

.brand-wordmark {
  display: block;
  width: min(160px, 100%);
  height: auto;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: inherit;
  opacity: 0.7;
}

.brand h1,
.hero h2,
.dialog h3,
.section-head h3,
.metric-card strong {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  text-decoration: none;
  transition: background 180ms ease, transform 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  background: linear-gradient(90deg, rgba(246, 195, 22, 0.22), rgba(84, 184, 229, 0.15));
  color: #ffffff;
  transform: translateX(2px);
}

.main-content {
  padding: 20px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(20, 25, 26, 0.97), rgba(36, 43, 45, 0.96)),
    linear-gradient(90deg, rgba(246, 195, 22, 0.16), rgba(84, 184, 229, 0.14));
  color: #f7fafc;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.hero h2 {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  max-width: 620px;
}

.hero-copy {
  margin-top: 6px;
  max-width: 620px;
  line-height: 1.3;
  color: rgba(247, 250, 252, 0.78);
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  z-index: 1;
}

.hero-stack {
  display: grid;
  gap: 8px;
  z-index: 1;
}

.hero-account-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.hero-profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-avatar-button {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.hero-avatar-image {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
}

.primary-button,
.ghost-button,
.ghost-icon {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

.primary-button:not(:disabled):hover,
.ghost-button:not(:disabled):hover,
.ghost-icon:not(:disabled):hover,
.sort-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.primary-button:not(:disabled):active,
.ghost-button:not(:disabled):active,
.ghost-icon:not(:disabled):active,
.sort-button:not(:disabled):active,
.primary-button.is-clicked,
.ghost-button.is-clicked,
.ghost-icon.is-clicked,
.sort-button.is-clicked {
  transform: translateY(1px) scale(0.985);
}

.primary-button:focus-visible,
.ghost-button:focus-visible,
.ghost-icon:focus-visible,
.sort-button:focus-visible {
  outline: 3px solid rgba(84, 184, 229, 0.38);
  outline-offset: 2px;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand-2), #ffe26e);
  color: #1a1f19;
  font-weight: 700;
}

.ghost-button,
.ghost-icon {
  background: rgba(84, 184, 229, 0.16);
  color: inherit;
}

.export-menu {
  position: relative;
}

.export-menu > summary {
  list-style: none;
}

.export-menu > summary::-webkit-details-marker {
  display: none;
}

.export-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.export-menu-trigger::after {
  content: "▾";
  font-size: 0.85rem;
  opacity: 0.8;
}

.export-menu[open] .export-menu-trigger::after {
  content: "▴";
}

.export-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 150px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  z-index: 20;
}

.export-menu-list .ghost-button {
  justify-content: flex-start;
  width: 100%;
}

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(21, 27, 28, 0.94);
  color: #f7fafc;
  box-shadow: 0 18px 36px rgba(17, 22, 24, 0.18);
  border-left: 4px solid var(--brand-3);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-error {
  border-left-color: var(--danger);
}

.toast.toast-success {
  border-left-color: #79d286;
}

.toast.toast-info {
  border-left-color: var(--brand-3);
}

.ghost-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.5rem;
}

.view {
  display: none;
  margin-top: 16px;
  animation: rise 220ms ease;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head p,
.card p,
.table-wrap,
.list-card {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.metric-card,
.list-card,
.table-wrap,
.setup-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.metric-card {
  padding: 20px;
}

.metric-card strong {
  display: block;
  font-size: 2rem;
  margin-top: 8px;
}

.card,
.setup-card,
.list-card {
  padding: 22px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.game-card {
  display: grid;
  gap: 18px;
}

.game-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.game-scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.game-team {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-team.is-emperors strong {
  color: var(--accent);
}

.game-team-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--line);
  padding: 4px;
}

.game-score {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink);
}

.game-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.game-filter-chip {
  border-radius: 999px;
}

.game-filter-chip.is-active {
  background: var(--accent);
  color: #0f1720;
  border-color: transparent;
}

.games-stage-stack {
  display: grid;
  gap: 18px;
}

.games-stage {
  display: grid;
  gap: 14px;
}

.games-stage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.games-stage-list {
  display: grid;
  gap: 12px;
}

.game-match {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(248,250,252,0.94)),
    linear-gradient(135deg, rgba(84, 184, 229, 0.06), rgba(246, 186, 66, 0.08));
  padding: 16px 18px;
  display: grid;
  gap: 14px;
}

.game-match-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.game-match-status-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.game-match-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.game-match-team {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-match-team strong {
  display: block;
  font-size: 1.02rem;
}

.game-match-team-away {
  justify-content: flex-end;
  text-align: right;
}

.game-match-center {
  min-width: 200px;
  display: grid;
  gap: 8px;
  text-align: center;
  justify-items: center;
}

.game-match-logo {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: contain;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--line);
  padding: 6px;
  flex: 0 0 auto;
}

.game-match-logo-fallback {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--ink);
}

.game-match-score {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.8rem, 2vw, 2.4rem);
  font-weight: 900;
  letter-spacing: 0.03em;
}

.game-match-score-separator {
  opacity: 0.45;
}

.game-match-kickoff {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.standings-card {
  display: grid;
  gap: 14px;
}

.standings-table-wrap {
  margin-top: 0;
}

.standings-table tbody tr.standings-row-emperors {
  background: rgba(246, 186, 66, 0.16);
}

.standings-team-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.standings-team-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--line);
  padding: 4px;
  flex: 0 0 auto;
}

.standings-team-logo-fallback {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--ink);
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.pill {
  background: rgba(84, 184, 229, 0.12);
  color: #166d94;
}

.status.active,
.status.activated,
.status.paid,
.status.paid_rookie_fee,
.status.paid_with_fee,
.status.valid,
.status.confirmed {
  background: rgba(32, 116, 79, 0.12);
  color: var(--success);
}

.status.pending,
.status.invited,
.status.due,
.status.expiring,
.status.not_collected,
.status.maybe {
  background: rgba(179, 108, 16, 0.12);
  color: var(--warning);
}

.status.not_invited {
  background: rgba(33, 104, 153, 0.12);
  color: #216899;
}

.status.exempt {
  background: rgba(33, 104, 153, 0.12);
  color: #216899;
}

.status.exit {
  background: rgba(80, 89, 97, 0.18);
  color: #4c5a63;
}

.sort-button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0;
}

.sort-button.is-active {
  color: var(--ink);
}

.equipment-sheet-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.equipment-sheet-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(84, 184, 229, 0.08);
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.equipment-sheet-tab.is-active {
  background: linear-gradient(135deg, var(--brand-2), #ffe26e);
  color: #1a1f19;
  border-color: rgba(246, 195, 22, 0.35);
  box-shadow: 0 8px 20px rgba(246, 195, 22, 0.25);
  font-weight: 700;
}

.status.inactive,
.status.overdue,
.status.expired,
.status.missing,
.status.not_applicable,
.status.declined {
  background: rgba(155, 48, 35, 0.12);
  color: var(--danger);
}

.status.deleted {
  background: rgba(80, 89, 97, 0.18);
  color: #4c5a63;
}

.table-wrap {
  overflow: visible;
}

.members-filter-sticky {
  position: sticky;
  top: 10px;
  z-index: 4;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  position: static;
  background: var(--paper-strong);
}

table thead {
  position: static;
}

table thead th {
  position: static;
  background: var(--paper-strong);
}

.members-sticky-header {
  position: fixed;
  top: 0;
  z-index: 60;
  display: none;
  pointer-events: none;
  overflow: hidden;
  background: var(--paper-strong);
  border-bottom: 1px solid var(--line);
}

.members-sticky-header-table {
  border-collapse: separate;
  border-spacing: 0;
}

.members-sticky-header th {
  background: var(--paper-strong);
  border-bottom: 1px solid var(--line);
}

.fees-sticky-header {
  position: fixed;
  top: 0;
  z-index: 60;
  display: none;
  pointer-events: none;
  overflow: hidden;
  background: var(--paper-strong);
  border-bottom: 1px solid var(--line);
}

.fees-sticky-header-table {
  border-collapse: separate;
  border-spacing: 0;
}

.fees-sticky-header th {
  background: var(--paper-strong);
  border-bottom: 1px solid var(--line);
}

.passes-sticky-header {
  position: fixed;
  top: 0;
  z-index: 60;
  display: none;
  pointer-events: none;
  overflow: hidden;
  background: var(--paper-strong);
  border-bottom: 1px solid var(--line);
}

.passes-sticky-header-table {
  border-collapse: separate;
  border-spacing: 0;
}

.passes-sticky-header th {
  background: var(--paper-strong);
  border-bottom: 1px solid var(--line);
}

tbody tr:hover {
  background: rgba(84, 184, 229, 0.06);
}

.split {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.2fr 0.8fr;
}

.list {
  display: grid;
  gap: 14px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.list-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.meta {
  font-size: 0.95rem;
  color: var(--muted);
}

.dialog {
  width: min(560px, calc(100vw - 24px));
  border: 0;
  border-radius: 28px;
  padding: 0;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

.dialog[open] {
  z-index: 1000;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.25);
}

.dialog-form {
  padding: 24px;
  display: grid;
  gap: 14px;
}

.equipment-photo-thumb-button {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.equipment-photo-dialog {
  width: min(980px, calc(100vw - 24px));
}

.equipment-photo-dialog-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 240px;
}

.equipment-photo-dialog-body img {
  max-width: 100%;
  max-height: min(72vh, 820px);
  object-fit: contain;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
}

.dialog-header,
.dialog-actions,
.form-grid {
  display: flex;
  gap: 14px;
}

.dialog-header,
.dialog-actions {
  justify-content: space-between;
  align-items: center;
}

.form-grid > * {
  flex: 1;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  background: #fcfdfe;
  border-radius: 14px;
  padding: 12px 14px;
}

.organization-chart {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.organization-root {
  display: grid;
  gap: 0;
  width: min(380px, 100%);
  border-radius: 20px;
  overflow: hidden;
  background: var(--paper-strong);
  border: 1px solid rgba(21, 27, 28, 0.12);
  box-shadow: var(--shadow);
}

.organization-root-header,
.organization-branch-header {
  padding: 12px 16px;
  color: white;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.organization-root-header {
  background: linear-gradient(135deg, #13253d, #1e4069);
}

.organization-root-body,
.organization-branch-body {
  padding: 14px;
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.96);
}

.organization-root-connector {
  width: 2px;
  height: 24px;
  background: linear-gradient(180deg, rgba(19, 37, 61, 0.72), rgba(84, 184, 229, 0.55));
}

.organization-branches {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  padding-top: 24px;
}

.organization-branches::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 2px;
  background: rgba(21, 27, 28, 0.12);
}

.organization-branch {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper-strong);
  border: 1px solid rgba(21, 27, 28, 0.12);
  box-shadow: var(--shadow);
}

.organization-branch::before {
  content: "";
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 24px;
  background: rgba(21, 27, 28, 0.12);
}

.organization-branch-header {
  background: linear-gradient(135deg, rgba(84, 184, 229, 0.95), rgba(29, 129, 180, 0.95));
}

.organization-people {
  display: grid;
  gap: 8px;
}

.organization-person-block {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(21, 27, 28, 0.04);
  border: 1px solid rgba(21, 27, 28, 0.06);
}

.organization-person-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.organization-person-link:hover {
  color: #166d94;
}

.organization-task-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.organization-task-item {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(246, 195, 22, 0.1);
  border: 1px solid rgba(246, 195, 22, 0.22);
  color: var(--ink);
}

.organization-task-details {
  border-top: 1px solid rgba(21, 27, 28, 0.08);
  padding-top: 8px;
}

.organization-task-summary {
  cursor: pointer;
  color: #166d94;
  font-weight: 700;
  list-style: none;
}

.organization-task-summary::-webkit-details-marker {
  display: none;
}

.setup-list {
  display: grid;
  gap: 14px;
}

.setup-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.setup-step span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(84, 184, 229, 0.14);
  color: #166d94;
  font-weight: 700;
  flex: 0 0 auto;
}

.muted {
  color: var(--muted);
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(247, 250, 252, 0.92);
  max-width: 380px;
}

.notice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-3);
  flex: 0 0 auto;
}

.notice.is-live .notice-dot {
  background: #79d286;
}

.notice.is-error .notice-dot {
  background: #f27d72;
}

.auth-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.inline-form {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.inline-form label {
  flex: 1 1 240px;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(84, 184, 229, 0.12);
  color: #166d94;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1040px) {
  .app-shell,
  .split,
  .grid.metrics,
  .grid.two-up,
  .dialog-header,
  .dialog-actions,
  .form-grid,
  .hero {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

@media (max-width: 820px) {
  .menu-toggle-button {
    display: flex;
  }

  .main-content {
    padding: 16px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 20px 16px;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 300ms ease;
    max-height: 100vh;
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .hero {
    padding: 14px;
  }
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.role-switcher {
  display: grid;
  gap: 6px;
  min-width: 180px;
  font-weight: 600;
  color: #f7fafc;
}

.role-switcher span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.76;
}

.role-switcher select {
  background: rgba(255, 255, 255, 0.12);
  color: #f7fafc;
  border-color: rgba(255, 255, 255, 0.18);
}

.role-switcher option {
  color: #151b1c;
}

.data-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(84, 184, 229, 0.12);
  color: #166d94;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.data-source-badge strong {
  color: #54b8e5;
  font-weight: 700;
}

.syncing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 193, 7, 0.12);
  color: #b36c10;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  animation: pulse-sync 2s infinite;
}

.sync-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffc107;
  animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-sync {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes pulse-dot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.8;
  }
}

.dashboard-layout {
  align-items: start;
}

.compact-row {
  align-items: center;
}

.dense-row {
  gap: 6px;
  margin-top: 0;
}

.member-card {
  display: grid;
  gap: 10px;
}

.member-card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.finance-summary-card {
  padding: 14px 18px;
}

.finance-summary-card p {
  margin: 0;
}

.locked-card {
  border-style: dashed;
}

.empty-state,
.locked-card {
  margin-top: 8px;
}

.compact-list {
  gap: 10px;
}

.compact-list p {
  margin: 4px 0 0;
}

.filter-card select,
.filter-label {
  display: grid;
  gap: 8px;
}

.status-filter-group {
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.status-filter-group legend {
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--ink);
}

.status-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(84, 184, 229, 0.08);
  border: 1px solid var(--line);
  font-weight: 500;
}

.status-check input {
  margin: 0;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.small-button {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
}

.profile-layout {
  display: grid;
  gap: 14px;
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

.profile-side-column {
  display: grid;
  gap: 14px;
}

.profile-main-card,
.compact-card {
  max-width: none;
}

.profile-main-card {
  grid-column: 1 / -1;
}

.profile-side-column {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-layout .card,
.profile-layout .compact-card {
  padding: 14px 16px;
  min-width: 0;
}

.profile-layout .form-grid {
  gap: 10px;
}

.profile-layout input,
.profile-layout select,
.profile-layout textarea {
  padding: 9px 10px;
}

.profile-layout .table-wrap table {
  margin-top: 2px;
}

.profile-layout .table-wrap {
  max-width: 100%;
  overflow-x: hidden;
}

.profile-layout table {
  width: 100%;
  table-layout: fixed;
}

.profile-layout th,
.profile-layout td {
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.profile-layout select,
.profile-layout input,
.profile-layout textarea {
  max-width: 100%;
}

.profile-layout .pill,
.profile-layout .meta,
.profile-layout .muted,
.profile-layout td,
.profile-layout th {
  overflow-wrap: anywhere;
}

.profile-layout .profile-side-column > .card {
  min-width: 0;
}

@media (max-width: 1080px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-side-column {
    grid-template-columns: 1fr;
  }
}

.profile-icon-button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.profile-icon-button::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: 8px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 999px;
  transform: translateX(-50%);
  box-sizing: border-box;
}

.profile-icon-button::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 14px;
  height: 7px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  transform: translateX(-50%);
  box-sizing: border-box;
}

.fee-row-input,
.fee-row-status-select {
  width: 100%;
  min-width: 110px;
}

.fee-row-note {
  width: 100%;
  min-width: 180px;
  margin-bottom: 8px;
}

.status-button {
  border: 0;
  cursor: pointer;
}

.member-inline-input {
  width: 100%;
  min-width: 100px;
  padding: 8px 10px;
  border-radius: 10px;
}

.member-inline-pass-status {
  min-width: 122px;
  width: auto;
}

.member-inline-pass-expiry {
  min-width: 160px;
}

.member-inline-pass-expiry {
  width: 100%;
}

.is-expiring-soon {
  background: rgba(207, 75, 54, 0.12) !important;
  border-color: rgba(207, 75, 54, 0.28) !important;
}

.member-inline-select {
  width: 100%;
  min-width: 120px;
  min-height: 74px;
}

.member-inline-multiselect {
  min-width: 150px;
}

.member-inline-multiselect > summary {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fcfdfe;
}

.member-inline-multiselect-options {
  margin-top: 6px;
  max-height: 170px;
  overflow: auto;
  display: grid;
  gap: 6px;
  padding-right: 4px;
}

.member-filters-dropdown summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.member-filters-dropdown summary::-webkit-details-marker {
  display: none;
}

.fee-filters-dropdown summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fee-filters-dropdown summary::-webkit-details-marker {
  display: none;
}

.pass-filters-dropdown summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pass-filters-dropdown summary::-webkit-details-marker {
  display: none;
}

.members-filter-card {
  padding: 10px 12px;
}

.fees-filter-card {
  padding: 10px 12px;
}

.member-filter-summary-label {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.84rem;
}

.member-filter-summary-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.member-filters-dropdown summary::after {
  content: "▾";
  font-size: 0.95rem;
  color: var(--muted);
  margin-left: auto;
}

.member-filters-dropdown[open] summary::after {
  content: "▴";
}

.fee-filters-dropdown summary::after {
  content: "▾";
  font-size: 0.95rem;
  color: var(--muted);
  margin-left: auto;
}

.fee-filters-dropdown[open] summary::after {
  content: "▴";
}

.pass-filters-dropdown summary::after {
  content: "▾";
  font-size: 0.95rem;
  color: var(--muted);
  margin-left: auto;
}

.pass-filters-dropdown[open] summary::after {
  content: "▴";
}

.danger-button {
  background: rgba(207, 75, 54, 0.12);
  color: var(--danger);
}

.auth-progress {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(84, 184, 229, 0.12);
  color: #166d94;
  font-weight: 600;
}

.auth-status {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(84, 184, 229, 0.08);
  color: #166d94;
  border: 1px solid rgba(84, 184, 229, 0.16);
  line-height: 1.4;
}

.auth-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(22, 109, 148, 0.22);
  border-top-color: #166d94;
  animation: auth-spin 0.8s linear infinite;
}

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