.statistics-hero {
  background:
    radial-gradient(circle at 20% 20%, rgba(180, 0, 20, 0.32), transparent 34%),
    linear-gradient(rgba(5, 5, 7, 0.62), rgba(5, 5, 7, 0.96)),
    url("../../images/ronin-hero.jpg") center center / cover no-repeat;
}

.statistics-shell {
  position: relative;
  max-width: 1540px;
  margin: 0 auto;
  padding: 84px 24px;
  overflow: hidden;
}

.statistics-shell::before {
  content: "";
  position: absolute;
  inset: 18px 8px;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 86%, transparent);
  animation: scanDrift 18s linear infinite;
}

.stats-database {
  position: relative;
  z-index: 1;
}

.stats-access-card,
.database-command-center,
.stats-control-bar,
.stats-panel,
.chart-card,
.command-stat-card {
  position: relative;
  background:
    linear-gradient(145deg, rgba(19, 21, 26, 0.96), rgba(5, 6, 9, 0.98)),
    radial-gradient(circle at top right, rgba(255, 55, 80, 0.12), transparent 42%);
  border: 1px solid rgba(190, 20, 42, 0.42);
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.42),
    0 0 32px rgba(160, 0, 22, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.stats-access-card::after,
.database-command-center::after,
.stats-control-bar::after,
.stats-panel::after,
.chart-card::after,
.command-stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.018),
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 7px
    );
  opacity: 0.45;
}

.stats-access-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px;
  text-align: center;
}

.stats-access-card h2,
.database-briefing h2,
.stats-control-bar h2,
.stats-panel h2 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--silver-bright);
}

.stats-access-card p,
.database-briefing p,
.panel-subtext {
  color: var(--text-muted);
  line-height: 1.7;
}

.database-command-center {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 26px;
  align-items: stretch;
  padding: 30px;
  margin-bottom: 24px;
}

.database-briefing {
  position: relative;
  z-index: 1;
}

.database-briefing h2 {
  margin: 8px 0 12px;
  font-size: clamp(1.6rem, 3vw, 2.55rem);
}

.database-briefing p {
  max-width: 820px;
  margin: 0;
}

.database-status-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.database-status-panel div {
  position: relative;
  min-height: 116px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom-color: rgba(255, 55, 80, 0.34);
}

.database-status-panel div::before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: #7cffc8;
  box-shadow: 0 0 16px rgba(124, 255, 200, 0.7);
  animation: statusBlink 1.9s ease-in-out infinite;
}

.database-status-panel span,
.command-stat-card span,
.ship-pull-form label {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.35px;
}

.database-status-panel strong {
  display: block;
  color: var(--silver-bright);
  font-family: "Orbitron", sans-serif;
  letter-spacing: 1px;
}

.stats-control-bar {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  grid-template-areas:
    "title filters"
    "title summary";
  align-items: center;
  gap: 24px;
  padding: 26px;
  margin-bottom: 24px;
}

.stats-control-bar > div:first-child {
  grid-area: title;
  position: relative;
  z-index: 1;
}

.stats-filters {
  grid-area: filters;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(130px, 160px) minmax(110px, 140px) minmax(150px, 190px);
  gap: 12px;
  justify-content: flex-end;
  align-items: stretch;
}

.filter-summary {
  grid-area: summary;
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  text-align: right;
}

.stats-filters select,
.stats-filters .btn,
.ship-pull-form input,
.ship-pull-form select {
  min-height: 48px;
  padding: 0 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    #07080b;
  color: #ffffff;
  border: 1px solid rgba(190, 20, 42, 0.46);
  font-family: "Inter", sans-serif;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.4);
}

.stats-filters select:focus,
.ship-pull-form input:focus,
.ship-pull-form select:focus {
  outline: none;
  border-color: rgba(255, 88, 111, 0.82);
  box-shadow:
    0 0 0 3px rgba(255, 70, 95, 0.13),
    0 0 20px rgba(180, 0, 20, 0.24);
}

.command-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  align-items: stretch;
}

.command-stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 154px;
  padding: 22px;
  border-left: 3px solid rgba(255, 55, 80, 0.78);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
  animation: statPulse 4.5s ease-in-out infinite;
}

.command-stat-card::before {
  content: "";
  position: absolute;
  inset: -40% -70%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, 0.09), transparent 62%);
  transform: translateX(-45%) rotate(8deg);
  animation: dataSweep 5.8s ease-in-out infinite;
}

.command-stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 94, 116, 0.98);
  box-shadow:
    0 26px 74px rgba(0, 0, 0, 0.48),
    0 0 34px rgba(180, 0, 24, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.command-stat-card span,
.command-stat-card strong,
.command-stat-card small {
  position: relative;
  z-index: 1;
}

.command-stat-card span {
  display: block;
  margin-bottom: 14px;
  line-height: 1.35;
}

.command-stat-card strong {
  display: block;
  min-height: 1.1em;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.45rem, 2.35vw, 2.28rem);
  line-height: 1.12;
  color: var(--silver-bright);
  overflow-wrap: anywhere;
  text-shadow:
    0 0 18px rgba(255, 70, 95, 0.2),
    0 0 2px rgba(255, 255, 255, 0.45);
}

.command-stat-card strong.stat-updated {
  animation: statUpdated 0.72s ease;
}

.command-stat-card small {
  display: block;
  margin-top: 10px;
  color: var(--text-muted);
  line-height: 1.45;
}

.popular-op-card {
  grid-column: span 2;
}

.stats-panel,
.chart-card {
  padding: 26px;
  margin-bottom: 24px;
}

.database-entry-panel {
  border-color: rgba(124, 255, 200, 0.22);
  overflow: visible;
  z-index: 5;
}

.stats-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.stats-panel-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.stats-panel-header .section-tag,
.stats-control-bar .section-tag {
  margin-bottom: 6px;
}

.leaderboard-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  max-height: 616px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 64, 88, 0.76) rgba(255, 255, 255, 0.06);
}

.leaderboard-list::-webkit-scrollbar {
  width: 8px;
}

.leaderboard-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.055);
}

.leaderboard-list::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(255, 74, 100, 0.92), rgba(128, 0, 18, 0.88));
  border: 1px solid rgba(255, 115, 135, 0.55);
  box-shadow: 0 0 14px rgba(255, 64, 88, 0.28);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background:
    linear-gradient(90deg, rgba(180, 0, 20, 0.16), rgba(255, 255, 255, 0.026));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 2px solid rgba(255, 55, 80, 0.72);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.leaderboard-row:hover {
  transform: translateX(5px);
  border-color: rgba(255, 80, 104, 0.55);
  background:
    linear-gradient(90deg, rgba(190, 0, 24, 0.24), rgba(255, 255, 255, 0.04));
}

.leaderboard-rank,
.leaderboard-value,
#shipsPulledTable td:last-child,
#shipKeyTypeTable td:last-child {
  font-family: "Orbitron", sans-serif;
}

.leaderboard-rank {
  color: #ff4058;
}

.leaderboard-name {
  color: var(--silver-bright);
  font-weight: 600;
}

.leaderboard-value {
  color: var(--silver);
}

.stats-table-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.16);
}

.stats-table th,
.stats-table td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.stats-table th {
  color: var(--silver-bright);
  font-family: "Orbitron", sans-serif;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 1.35px;
  background: rgba(255, 255, 255, 0.035);
}

.stats-table td {
  color: var(--text-muted);
}

.stats-table tr {
  transition: background 0.18s ease;
}

.stats-table tbody tr:hover {
  background: rgba(255, 55, 80, 0.08);
}

.stats-table td:first-child {
  color: var(--silver-bright);
  font-weight: 600;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.chart-card {
  min-height: 378px;
}

.chart-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 20px;
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  font-size: 1rem;
  color: var(--silver-bright);
}

.chart-card canvas {
  position: relative;
  z-index: 1;
  max-height: 292px;
}

.inactive-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.inactive-grid article {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.075);
}

.inactive-grid h3 {
  margin: 0 0 14px;
  color: #ff4058;
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 0.9rem;
}

.inactive-list {
  display: grid;
  gap: 8px;
}

.inactive-member {
  padding: 10px 12px;
  color: var(--silver);
  background: rgba(120, 0, 15, 0.14);
  border: 1px solid rgba(180, 0, 20, 0.24);
  font-size: 0.86rem;
}

.empty-stats {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stats-message {
  position: relative;
  z-index: 1;
  color: var(--text-muted);
  text-align: center;
}

.ship-pull-form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(210px, 1.05fr) minmax(210px, 1.05fr) minmax(210px, 1.05fr) minmax(180px, 1fr) minmax(140px, 0.62fr);
  gap: 16px;
  align-items: end;
}

.ship-pull-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ship-pull-form input,
.ship-pull-form select {
  width: 100%;
  font-size: 0.92rem;
}

.ship-pull-form select option {
  background: #080808;
  color: #ffffff;
}

.ship-pull-form button {
  justify-self: stretch;
  min-height: 48px;
  width: 100%;
  max-width: 190px;
  padding-inline: 16px;
  line-height: 1.05;
  white-space: nowrap;
}

.ship-pull-form .stats-message {
  grid-column: 1 / -1;
  margin: 0;
  text-align: left;
}

.stats-tools-panel {
  border-color: rgba(124, 255, 200, 0.2);
}

.admin-only-tools {
  border-color: rgba(255, 211, 90, 0.28);
}

.stats-form-toggle {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  width: 100%;
  min-height: 78px;
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 55, 80, 0.34);
  border-left: 4px solid rgba(255, 55, 80, 0.78);
  background:
    linear-gradient(90deg, rgba(255, 55, 80, 0.12), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    rgba(5, 5, 8, 0.82);
  color: var(--silver-bright);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.stats-form-toggle::after {
  content: "";
  position: absolute;
  inset: -60% auto -60% -26%;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  transform: skewX(-18deg);
  opacity: 0;
  transition: transform 360ms ease, opacity 220ms ease;
}

.stats-form-toggle:hover::after,
.stats-form-toggle.active::after {
  opacity: 1;
  transform: translateX(360%) skewX(-18deg);
}

.stats-form-toggle span {
  display: grid;
  gap: 5px;
}

.stats-form-toggle strong {
  font-family: "Orbitron", sans-serif;
  font-size: 0.98rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.stats-form-toggle small {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.stats-form-toggle em {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid rgba(255, 55, 80, 0.46);
  background: rgba(255, 55, 80, 0.1);
  color: #ff6f7c;
  font-family: "Orbitron", sans-serif;
  font-size: 0.72rem;
  font-style: normal;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stats-form-toggle.active {
  border-color: rgba(124, 255, 200, 0.28);
  border-left-color: rgba(124, 255, 200, 0.82);
  background:
    linear-gradient(90deg, rgba(124, 255, 200, 0.1), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    rgba(5, 5, 8, 0.82);
}

.stats-form-toggle.active em {
  border-color: rgba(124, 255, 200, 0.42);
  background: rgba(124, 255, 200, 0.08);
  color: #7cffc8;
}

.ledger-form-toggle {
  border-color: rgba(255, 211, 90, 0.34);
  border-left-color: rgba(255, 211, 90, 0.78);
  background:
    linear-gradient(90deg, rgba(255, 211, 90, 0.1), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    rgba(5, 5, 8, 0.82);
}

.ledger-form-toggle em {
  border-color: rgba(255, 211, 90, 0.42);
  background: rgba(255, 211, 90, 0.08);
  color: #ffd35a;
}

.collapsible-form-panel {
  margin-top: 16px;
}

.collapsible-form-panel[hidden] {
  display: none;
}

.stats-tool-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-tool-grid {
  grid-template-columns: minmax(320px, 720px);
  justify-content: start;
}

.archive-tool-grid {
  grid-template-columns: minmax(320px, 1040px);
}

.archive-operation-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-entry-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)),
    rgba(0, 0, 0, 0.22);
}

.ledger-popout-content {
  width: min(760px, 94vw);
}

.ledger-popout-form {
  margin-top: 16px;
}

.ledger-member-field {
  position: relative;
}

.commander-name-field {
  position: relative;
}

.ship-puller-field {
  position: relative;
  z-index: 8;
}

.ledger-member-results {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.ship-puller-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(300px, calc(100vw - 48px));
  z-index: 20;
  max-height: 190px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 0;
  padding: 8px;
  border: 1px solid rgba(190, 20, 42, 0.42);
  background:
    linear-gradient(145deg, rgba(12, 13, 18, 0.98), rgba(3, 4, 7, 0.98)),
    radial-gradient(circle at top left, rgba(255, 55, 80, 0.12), transparent 42%);
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.48),
    0 0 22px rgba(180, 0, 22, 0.16);
}

.ship-puller-results .participant-result-group,
.ship-puller-results .participant-result-btn {
  min-width: 0;
}

.ship-puller-results .participant-result-group {
  gap: 7px;
}

.ship-puller-results .participant-result-group > span {
  font-size: 0.6rem;
}

.ship-puller-results .participant-result-btn {
  gap: 3px;
  padding: 8px 10px;
}

.ship-puller-results .manual-name-suggestion-btn {
  width: 100%;
}

.ship-puller-results .participant-result-btn strong {
  font-size: 0.78rem;
}

.ship-puller-results .participant-result-btn strong,
.ship-puller-results .participant-result-btn span {
  overflow-wrap: anywhere;
  white-space: normal;
}

.ship-puller-results .participant-result-btn span {
  font-size: 0.78rem;
  line-height: 1.25;
}

.ship-puller-results:empty {
  display: none;
}

.commander-name-results {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.archive-popout-content {
  width: min(1120px, 96vw);
  max-height: 88vh;
  overflow: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.archive-popout-content h2 {
  margin-bottom: 4px;
}

.archive-popout-content .panel-subtext {
  margin-bottom: 8px;
}

.archive-popout-form {
  margin-top: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  max-height: calc(88vh - 132px);
  overflow-y: auto;
  padding-right: 18px;
}

.archive-popout-form label {
  gap: 6px;
  font-size: 0.66rem;
}

.archive-popout-form input,
.archive-popout-form textarea,
.archive-popout-form select {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.86rem;
}

.archive-popout-form textarea {
  min-height: 76px;
}

.archive-popout-form .backlog-participant-builder {
  padding: 12px;
}

.archive-popout-form .backlog-participant-heading {
  margin-bottom: 10px;
}

.archive-popout-form .backlog-participant-heading h4 {
  font-size: 0.78rem;
}

.archive-popout-form .backlog-participant-heading p {
  font-size: 0.78rem;
}

.archive-popout-form .backlog-participant-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 140px;
  overflow-y: auto;
  padding-right: 4px;
}

.stats-entry-form h3 {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  color: var(--silver-bright);
  font-family: "Orbitron", sans-serif;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.stats-entry-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.stats-entry-form .wide {
  grid-column: 1 / -1;
}

.stats-entry-form input,
.stats-entry-form textarea,
.stats-entry-form select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(190, 20, 42, 0.46);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)),
    #07080b;
  color: #ffffff;
  font-family: "Inter", sans-serif;
}

.stats-entry-form textarea {
  resize: vertical;
}

.stats-entry-form button,
.stats-entry-form .stats-message {
  grid-column: 1 / -1;
}

.backlog-participant-builder {
  padding: 16px;
  border: 1px solid rgba(124, 255, 200, 0.16);
  background:
    linear-gradient(135deg, rgba(124, 255, 200, 0.055), transparent 44%),
    rgba(0, 0, 0, 0.18);
}

.backlog-participant-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.backlog-participant-heading h4 {
  margin: 0 0 6px;
  color: var(--silver-bright);
  font-family: "Orbitron", sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.1px;
}

.backlog-participant-heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  letter-spacing: 0;
  text-transform: none;
}

.backlog-participant-heading span {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(124, 255, 200, 0.36);
  background: rgba(124, 255, 200, 0.07);
  color: #7cffc8;
  font-family: "Orbitron", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.backlog-participant-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.backlog-participant-controls input {
  min-height: 44px;
}

.backlog-participant-controls button {
  min-height: 44px;
  white-space: nowrap;
}

.participant-search-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.participant-result-group {
  display: grid;
  gap: 8px;
}

.participant-result-group > span {
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.manual-result-group {
  margin-top: 4px;
}

.participant-result-btn {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(124, 255, 200, 0.22);
  background:
    linear-gradient(90deg, rgba(124, 255, 200, 0.08), rgba(255, 255, 255, 0.015)),
    #07080b;
  color: var(--silver);
  text-align: left;
  cursor: pointer;
}

.manual-name-suggestion-btn {
  border-color: rgba(255, 211, 90, 0.24);
  background:
    linear-gradient(90deg, rgba(255, 211, 90, 0.08), rgba(255, 255, 255, 0.015)),
    #07080b;
}

.participant-result-btn strong {
  color: var(--silver-bright);
  font-family: "Orbitron", sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.participant-result-btn span,
.no-results {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: 0;
}

.backlog-participant-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.backlog-participant-chip {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-left: 3px solid rgba(255, 55, 80, 0.78);
  background: rgba(5, 5, 7, 0.72);
}

.backlog-participant-chip span {
  display: block;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.backlog-participant-chip strong {
  color: var(--silver-bright);
  font-family: "Orbitron", sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.backlog-participant-chip button {
  width: 30px;
  min-height: 30px;
  border: 1px solid rgba(255, 55, 80, 0.46);
  background: rgba(255, 55, 80, 0.1);
  color: #ff6f7c;
  cursor: pointer;
}

.unlinked-credit-panel {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(255, 211, 90, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 211, 90, 0.06), transparent 42%),
    rgba(0, 0, 0, 0.18);
}

.unlinked-credit-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.unlinked-credit-header h3 {
  margin: 0 0 6px;
  color: var(--silver-bright);
  font-family: "Orbitron", sans-serif;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.unlinked-credit-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.unlinked-credit-header span {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(255, 211, 90, 0.42);
  color: #ffd35a;
  background: rgba(255, 211, 90, 0.08);
  font-family: "Orbitron", sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.1px;
}

.unlinked-credit-lanes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.unlinked-credit-lane {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.01)),
    rgba(0, 0, 0, 0.16);
}

.unlinked-credit-lane .unlinked-credit-list {
  display: none;
}

.strong-match-lane {
  border-color: rgba(124, 255, 200, 0.22);
}

.no-match-lane {
  border-color: rgba(255, 211, 90, 0.2);
}

.unlinked-lane-toggle {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid rgba(255, 211, 90, 0.72);
  background:
    linear-gradient(90deg, rgba(255, 211, 90, 0.08), transparent 50%),
    rgba(5, 5, 7, 0.68);
  color: var(--silver-bright);
  text-align: left;
  cursor: pointer;
}

.strong-match-lane .unlinked-lane-toggle {
  border-left-color: rgba(124, 255, 200, 0.78);
  background:
    linear-gradient(90deg, rgba(124, 255, 200, 0.08), transparent 50%),
    rgba(5, 5, 7, 0.68);
}

.unlinked-lane-toggle span {
  display: grid;
  gap: 5px;
}

.unlinked-lane-toggle strong {
  margin: 0;
  color: var(--silver-bright);
  font-family: "Orbitron", sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1.1px;
}

.unlinked-lane-toggle small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.unlinked-lane-toggle em {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.035);
  font-family: "Orbitron", sans-serif;
  font-size: 0.64rem;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.strong-match-lane .unlinked-lane-toggle em {
  border-color: rgba(124, 255, 200, 0.34);
  color: #7cffc8;
  background: rgba(124, 255, 200, 0.07);
}

.no-match-lane .unlinked-lane-toggle em {
  border-color: rgba(255, 211, 90, 0.32);
  color: #ffd35a;
  background: rgba(255, 211, 90, 0.07);
}

.unlinked-lane-toggle.active {
  border-color: rgba(124, 255, 200, 0.24);
}

.stats-popout-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(120, 0, 20, 0.14), transparent 46%),
    rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.stats-popout-modal[hidden] {
  display: none;
}

.stats-popout-content {
  position: relative;
  width: min(980px, 94vw);
  max-height: min(760px, 86vh);
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(255, 55, 80, 0.34);
  border-left: 4px solid rgba(255, 55, 80, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 55, 80, 0.08), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
    #050507;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
}

.stats-popout-content h2 {
  margin: 6px 44px 8px 0;
  color: var(--silver-bright);
  font-family: "Orbitron", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.stats-popout-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  min-height: 38px;
  border: 1px solid rgba(255, 55, 80, 0.48);
  background: rgba(255, 55, 80, 0.1);
  color: #ff6f7c;
  font-size: 1.5rem;
  cursor: pointer;
}

.unlinked-credit-list {
  display: grid;
  gap: 12px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 6px;
  margin-top: 18px;
}

.unlinked-credit-list[hidden] {
  display: none;
}

.unlinked-credit-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-left: 3px solid rgba(255, 211, 90, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background:
    linear-gradient(90deg, rgba(255, 211, 90, 0.08), transparent 44%),
    rgba(5, 5, 7, 0.74);
}

.strong-match-card {
  border-left-color: rgba(124, 255, 200, 0.78);
  background:
    linear-gradient(90deg, rgba(124, 255, 200, 0.08), transparent 44%),
    rgba(5, 5, 7, 0.74);
}

.waiting-match-card {
  border-left-color: rgba(255, 211, 90, 0.68);
}

.strong-match-card .unlinked-credit-tag,
.strong-match-card .unlinked-credit-match span {
  color: #7cffc8;
}

.unlinked-credit-tag,
.unlinked-credit-match span {
  color: #ffd35a;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.unlinked-credit-main h4 {
  margin: 6px 0;
  color: var(--silver-bright);
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
}

.unlinked-credit-main p,
.unlinked-credit-match strong {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.unlinked-credit-match {
  display: grid;
  gap: 6px;
}

.review-credit-btn {
  justify-self: start;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.7rem;
  letter-spacing: 1px;
}

.review-credit-btn[aria-expanded="true"] {
  border-color: rgba(124, 255, 200, 0.42);
  color: #7cffc8;
  background: rgba(124, 255, 200, 0.08);
}

.unlinked-credit-actions {
  display: grid;
  grid-template-columns: minmax(180px, 240px) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(124, 255, 200, 0.16);
  background: rgba(0, 0, 0, 0.2);
}

.unlinked-credit-actions label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.unlinked-credit-actions select {
  min-height: 36px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(190, 20, 42, 0.46);
  background: #07080b;
  color: #ffffff;
  font-size: 0.8rem;
}

.unlinked-credit-actions button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.stats-message[data-type="success"] {
  color: #7cffc8;
}

.stats-message[data-type="error"] {
  color: #ff6f7c;
}

#shipPullPieChart {
  max-height: 300px;
}

@keyframes scanDrift {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 54px 108px, 54px 108px;
  }
}

@keyframes statusBlink {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes dataSweep {
  0%,
  62% {
    transform: translateX(-45%) rotate(8deg);
  }

  100% {
    transform: translateX(45%) rotate(8deg);
  }
}

@keyframes statPulse {
  0%,
  100% {
    border-color: rgba(255, 55, 80, 0.5);
  }

  50% {
    border-color: rgba(255, 55, 80, 0.9);
  }
}

@keyframes statUpdated {
  0% {
    color: #ffffff;
    text-shadow: 0 0 0 rgba(124, 255, 200, 0);
    transform: translateY(4px);
  }

  45% {
    color: #7cffc8;
    text-shadow: 0 0 22px rgba(124, 255, 200, 0.55);
    transform: translateY(0);
  }

  100% {
    color: var(--silver-bright);
    text-shadow:
      0 0 18px rgba(255, 70, 95, 0.2),
      0 0 2px rgba(255, 255, 255, 0.45);
  }
}

@media (max-width: 1280px) {
  .stats-control-bar {
    grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  }

  .stats-filters {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .command-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }

  .popular-op-card {
    grid-column: span 1;
  }

  .ship-pull-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-tool-grid {
    grid-template-columns: 1fr;
  }

  .ship-pull-form button {
    grid-column: auto;
    max-width: none;
    white-space: normal;
  }

  .archive-popout-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-popout-form .backlog-participant-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .database-command-center,
  .stats-two-column,
  .chart-grid,
  .inactive-grid,
  .stats-tool-grid {
    grid-template-columns: 1fr;
  }

  .stats-control-bar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "filters"
      "summary";
  }

  .stats-filters {
    justify-content: start;
  }

  .filter-summary {
    text-align: left;
  }

  .stats-form-toggle {
    align-items: flex-start;
    flex-direction: column;
  }

  .unlinked-credit-lanes {
    grid-template-columns: 1fr;
  }

  .unlinked-credit-card {
    grid-template-columns: 1fr;
  }

  .unlinked-credit-actions {
    grid-template-columns: 1fr;
  }

  .backlog-participant-controls,
  .backlog-participant-list {
    grid-template-columns: 1fr;
  }

  .archive-operation-form,
  .stats-entry-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .statistics-shell {
    padding: 56px 16px;
  }

  .database-command-center,
  .stats-control-bar,
  .stats-panel,
  .chart-card {
    padding: 20px;
  }

  .database-status-panel,
  .command-card-grid,
  .ship-pull-form {
    grid-template-columns: 1fr;
  }

  .popular-op-card {
    grid-column: span 1;
  }

  .leaderboard-row {
    grid-template-columns: 44px 1fr;
  }

  .leaderboard-value {
    grid-column: 2;
  }

  .stats-filters select,
  .stats-filters .btn {
    width: 100%;
  }

  .stats-filters {
    grid-template-columns: 1fr;
  }

  .ship-pull-form button,
  .ship-pull-form .stats-message,
  .stats-entry-form button,
  .stats-entry-form .stats-message,
  .stats-entry-form .wide {
    grid-column: 1;
  }

  .stats-entry-form {
    grid-template-columns: 1fr;
  }
}
