.roster-page {
  flex: 1;
  width: min(
    1500px,
    calc(100% - 48px)
  );
  margin: 55px auto 110px;
}

.roster-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
}

.roster-heading h1 {
  margin: 18px 0 10px;
  font-size: clamp(
    38px,
    5vw,
    64px
  );
  letter-spacing: -0.05em;
}

.roster-heading p {
  margin: 0;
  color: var(--muted);
}

.roster-add-button {
  padding: 15px 22px;
  border: 0;
  border-radius: 13px;
  background:
    linear-gradient(
      135deg,
      var(--red-light),
      var(--red)
    );
  color: white;
  cursor: pointer;
  font-weight: 800;
}

.roster-selector-card {
  margin-top: 35px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}

.roster-selector-card label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.roster-selector-card select {
  min-width: 320px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: var(--card-light);
  color: white;
}

.roster-table-card {
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card);
}

.roster-table-header,
.roster-row {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.4fr)
    minmax(150px, 0.9fr)
    minmax(100px, 0.55fr)
    minmax(170px, 0.8fr)
    minmax(130px, 0.7fr)
    minmax(120px, 0.65fr)
    auto;
  align-items: center;
  gap: 18px;
}

.roster-table-header {
  min-height: 62px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.roster-section-title {
  padding: 13px 24px;
  background:
    linear-gradient(
      90deg,
      rgba(169, 24, 33, 0.7),
      rgba(101, 9, 15, 0.4)
    );
  font-weight: 800;
  text-align: center;
}

.roster-rank-title {
  padding: 9px 24px;
  border-bottom: 1px solid var(--border);
  background:
    rgba(255, 255, 255, 0.045);
  color: #c9cbd1;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.roster-row {
  min-height: 82px;
  padding: 13px 24px;
  border-bottom: 1px solid var(--border);
}

.roster-row:last-child {
  border-bottom: 0;
}

.roster-member {
  display: flex;
  align-items: center;
  gap: 13px;
}

.roster-member img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.roster-member div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.roster-member strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-member small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.roster-discord {
  color: #c7cad1;
  font-size: 13px;
}

.callsign-badge,
.rank-badge,
.company-badge,
.primary-status {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.callsign-badge {
  color: #ff8189;
  background: rgba(167, 24, 32, 0.18);
}

.rank-badge {
  color: #ffd978;
  background: rgba(121, 72, 0, 0.2);
}

.company-badge {
  color: #e7e8eb;
  background: rgba(255, 255, 255, 0.07);
}

.primary-status.yes {
  color: #46e596;
  background: rgba(20, 147, 85, 0.18);
}

.primary-status.no {
  color: #ff7780;
  background: rgba(166, 28, 37, 0.18);
}

.roster-actions {
  display: flex;
  gap: 7px;
}

.roster-actions button {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-light);
  color: white;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.roster-actions
.remove-roster-member {
  color: #ff747d;
}

.roster-empty-row {
  padding: 28px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  text-align: center;
}

.roster-modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.roster-modal-backdrop[hidden] {
  display: none;
}

.roster-modal {
  width: min(500px, 100%);
  padding: 28px;
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  background: #111319;
  box-shadow: var(--shadow);
}

.roster-modal-heading {
  margin-bottom: 25px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.roster-modal-heading span {
  color: #eb5e67;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.roster-modal-heading h2 {
  margin: 7px 0 0;
}

.roster-modal-heading button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card-light);
  color: white;
  cursor: pointer;
  font-size: 23px;
}

.roster-modal label {
  margin-top: 17px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: #b8bbc3;
  font-size: 12px;
  font-weight: 700;
}

.roster-modal input {
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #090a0e;
  color: white;
}

.roster-modal input:focus {
  border-color: var(--red-light);
}

.roster-form-message {
  min-height: 20px;
  color: #ff737c;
  font-size: 12px;
}

.roster-submit-button {
  width: 100%;
  min-height: 49px;
  border: 0;
  border-radius: 11px;
  background:
    linear-gradient(
      135deg,
      var(--red-light),
      var(--red)
    );
  color: white;
  cursor: pointer;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .roster-table-card {
    overflow-x: auto;
  }

  .roster-table-header,
  .roster-row {
    min-width: 1100px;
  }
}

@media (max-width: 700px) {
  .roster-page {
    width: calc(100% - 24px);
  }

  .roster-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .roster-selector-card {
    align-items: stretch;
    flex-direction: column;
  }

  .roster-selector-card select {
    width: 100%;
    min-width: 0;
  }
}