:root {
  color-scheme: dark;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: var(--ink-black);
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--ink-black), var(--charcoal-blue));
  color: var(--ash-grey);
}

a {
  color: var(--ash-grey);
}

.page {
  width: min(96vw, 1200px);
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.card {
  background: rgba(1, 8, 19, 0.7);
  border: 1px solid rgba(198, 201, 190, 0.1);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}


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

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stack {
  display: grid;
  gap: 12px;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--charcoal-blue);
  display: grid;
  place-items: center;
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(198, 201, 190, 0.1);
  border: 1px solid rgba(198, 201, 190, 0.2);
  color: var(--ash-grey);
  font-weight: 600;
  font-size: 14px;
}

.header-link {
  color: inherit;
  text-decoration: none;
}

.header-link:hover {
  text-decoration: underline;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

th,
td {
  padding: 6px;
  border-bottom: 1px solid rgba(198, 201, 190, 0.08);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(198, 201, 190, 0.8);
}

.division-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.divisions-col {
  white-space: nowrap;
}

.division-inline {
  gap: 4px;
}

.division-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.division-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  background: rgba(198, 201, 190, 0.08);
  text-transform: uppercase;
}

.division-aca {
  color: #7fd4ff;
  border-color: rgba(127, 212, 255, 0.55);
  box-shadow: 0 0 14px rgba(127, 212, 255, 0.25);
}

.division-op {
  color: #ffe66d;
  border-color: rgba(255, 230, 109, 0.55);
  box-shadow: 0 0 14px rgba(255, 230, 109, 0.25);
}

.division-log {
  color: #7dff9a;
  border-color: rgba(125, 255, 154, 0.55);
  box-shadow: 0 0 14px rgba(125, 255, 154, 0.25);
}

.division-med {
  color: #ff8aa0;
  border-color: rgba(255, 138, 160, 0.55);
  box-shadow: 0 0 14px rgba(255, 138, 160, 0.25);
}

input,
button,
textarea {
  background: rgba(198, 201, 190, 0.05);
  border: 1px solid rgba(198, 201, 190, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ash-grey);
  font-size: 14px;
}

button {
  cursor: pointer;
  background: var(--charcoal-blue);
  border-color: rgba(198, 201, 190, 0.2);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.muted {
  color: rgba(198, 201, 190, 0.7);
  font-size: 14px;
}

.small-label {
  font-size: 12px;
}

.nowrap {
  white-space: nowrap;
}

.table-wrapper {
  overflow-x: hidden;
}

.table-wrapper.edit-mode tbody tr,
.table-wrapper[data-edit-mode="1"] tbody tr {
  cursor: pointer;
}

.table-wrapper.edit-mode tbody tr td,
.table-wrapper[data-edit-mode="1"] tbody tr td {
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.table-wrapper.edit-mode tbody tr:hover td,
.table-wrapper[data-edit-mode="1"] tbody tr:hover td {
  background: rgba(156, 202, 229, 0.08);
}

.row-selected td {
  background: rgba(156, 202, 229, 0.14);
  box-shadow: inset 0 0 0 1px rgba(156, 202, 229, 0.35);
}

.inline-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  flex-wrap: nowrap;
}

.inline-edit form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-mini {
  width: 52px;
  background: rgba(198, 201, 190, 0.12);
}

.points-col {
  width: 80px;
}

.total-col {
  width: 50px;
}

td.points-col,
td.progress-col {
  overflow: hidden;
  text-overflow: ellipsis;
}

td.points-col {
  white-space: nowrap;
}

th.points-col,
td.points-col {
  white-space: nowrap;
}

th.total-col,
td.total-col {
  white-space: nowrap;
}

th.member-col,
td.member-col {
  width: 180px;
}

th.divisions-col,
td.divisions-col {
  width: 50px;
}

th.tz-col,
td.tz-col {
  width: 64px;
}

th.rank-col,
td.rank-col {
  width: 60px;
}

td.rank-col {
  overflow: visible;
}

th.progress-col,
td.progress-col {
  width: 240px;
}

th.admin-col,
td.admin-col {
  width: 90px;
}

@media (min-width: 1920px) {
  th.member-col,
  td.member-col {
    width: 200px;
  }
  th.progress-col,
  td.progress-col {
    width: 280px;
  }
  th.admin-col,
  td.admin-col {
    width: 90px;
  }
  .points-col {
    width: 80px;
  }
  .total-col {
    width: 50px;
  }
  .inline-edit {
    min-width: 90px;
  }
  .input-mini {
    width: 48px;
  }
}

@media (min-width: 2560px) {
  th.member-col,
  td.member-col {
    width: 220px;
  }
  th.progress-col,
  td.progress-col {
    width: 320px;
  }
  th.admin-col,
  td.admin-col {
    width: 100px;
  }
}

.rank-mismatch {
  color: #ffe66d;
  font-weight: 700;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(198, 201, 190, 0.12);
  border: 1px solid rgba(198, 201, 190, 0.3);
  color: #f7f2d1;
  position: relative;
  z-index: 1;
}

.rank-pill-leadership {
  position: relative;
}

.rank-pill-leadership::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.6), 0 0 24px rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.rank-pill-warn {
  border-color: rgba(255, 230, 109, 0.8);
  box-shadow: 0 0 16px rgba(255, 230, 109, 0.45), 0 0 20px rgba(127, 212, 255, 0.35);
}

.admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-transform: uppercase;
}

.admin-chip-warn {
  color: #ffe66d;
  border-color: rgba(255, 230, 109, 0.5);
  background: rgba(255, 230, 109, 0.12);
}

.admin-chip-note {
  color: #9ccae5;
  border-color: rgba(156, 202, 229, 0.5);
  background: rgba(156, 202, 229, 0.12);
}

th.points-col,
td.points-col,
th.total-col,
td.total-col {
  padding-left: 6px;
  padding-right: 6px;
}

@media (min-width: 1280px) {
  .page {
    width: min(96vw, 1400px);
  }
  .points-col {
    width: 80px;
  }
}

@media (min-width: 1920px) {
  .page {
    width: min(96vw, 1720px);
  }
  .points-col {
    width: 80px;
  }
  .total-col {
    width: 50px;
  }
  .inline-edit {
    min-width: 104px;
  }
  .input-mini {
    width: 48px;
  }
}

@media (min-width: 2560px) {
  .page {
    width: min(96vw, 2200px);
  }
  .table-wrapper {
    overflow-x: hidden;
  }
}

@media (min-width: 3440px) {
  .page {
    width: min(96vw, 3000px);
  }
  .inline-edit {
    min-width: 100px;
  }
}

@media (min-width: 3840px) {
  .page {
    width: min(96vw, 3600px);
  }
}

.btn-ghost {
  background: rgba(198, 201, 190, 0.08);
  border: 1px solid rgba(198, 201, 190, 0.25);
  padding: 6px 10px;
}

.btn-ghost:hover {
  background: rgba(198, 201, 190, 0.15);
}

.btn-apply {
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 16px;
  background: rgba(156, 202, 229, 0.18);
  border: 1px solid rgba(156, 202, 229, 0.5);
  color: #9ccae5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-apply:hover {
  background: rgba(156, 202, 229, 0.32);
}

.feedback-card {
  max-width: 900px;
  margin: 0 auto;
}

.form-stack {
  display: grid;
  gap: 16px;
  padding: 12px 4px 0;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-label {
  font-weight: 600;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.status-banner {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(125, 255, 154, 0.35);
  background: rgba(125, 255, 154, 0.1);
  color: #7dff9a;
}

.status-select {
  background: rgba(198, 201, 190, 0.08);
  border: 1px solid rgba(198, 201, 190, 0.25);
  color: rgba(240, 240, 240, 0.9);
  border-radius: 8px;
  padding: 6px 10px;
}

.btn-danger {
  background: rgba(180, 78, 58, 0.2);
  border-color: rgba(180, 78, 58, 0.6);
  color: #f1c1b6;
}

.btn-danger:hover {
  background: rgba(180, 78, 58, 0.35);
}

.progress {
  width: 90%;
  height: 8px;
  border-radius: 999px;
  background: rgba(198, 201, 190, 0.08);
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-col .small-label {
  display: block;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--charcoal-blue), var(--ash-grey));
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(198, 201, 190, 0.2);
}

.status-muted {
  color: rgba(198, 201, 190, 0.7);
  background: rgba(198, 201, 190, 0.08);
}

.status-active {
  color: #b9e3a0;
  background: rgba(120, 166, 102, 0.2);
  border-color: rgba(120, 166, 102, 0.5);
}

.status-info {
  color: #9ccae5;
  background: rgba(54, 94, 123, 0.25);
  border-color: rgba(54, 94, 123, 0.5);
}

.delta-positive {
  color: #b9e3a0;
  font-weight: 600;
}

.delta-negative {
  color: #f1c1b6;
  font-weight: 600;
}

.note-cell {
  max-width: 320px;
  white-space: normal;
  word-break: break-word;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(127, 212, 255, 0.55);
  background: rgba(10, 18, 28, 0.7);
  box-shadow: 0 0 16px rgba(127, 212, 255, 0.35);
}

.legend-pill-rank {
  font-weight: 700;
}

.legend-pill-points {
  font-size: 12px;
  font-weight: 700;
  color: rgba(198, 201, 190, 0.8);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 230, 109, 0.45);
  box-shadow: 0 0 12px rgba(255, 230, 109, 0.35);
}

.rank-ladder {
  list-style: none;
  margin: 0;
  padding: 0 0 0 28px;
  display: grid;
  gap: 12px;
  position: relative;
  max-width: 560px;
}

.rank-ladder::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 999px;
  background: rgba(127, 212, 255, 0.35);
  box-shadow: 0 0 18px rgba(127, 212, 255, 0.35);
}

.rank-step {
  position: relative;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(127, 212, 255, 0.35);
  background: rgba(10, 18, 28, 0.65);
  max-width: 520px;
}

.rank-step::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  width: 18px;
  height: 2px;
  background: rgba(127, 212, 255, 0.55);
  box-shadow: 0 0 10px rgba(127, 212, 255, 0.45);
  transform: translateY(-50%);
}

.rank-step::after {
  content: "";
  position: absolute;
  left: -26px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(127, 212, 255, 0.85);
  box-shadow: 0 0 12px rgba(127, 212, 255, 0.7);
  transform: translateY(-50%);
}

.rank-step-label {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.rank-step-name {
  font-weight: 700;
}

.rank-step-points {
  font-size: 12px;
  font-weight: 700;
  color: rgba(198, 201, 190, 0.85);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 230, 109, 0.45);
  box-shadow: 0 0 12px rgba(255, 230, 109, 0.35);
  justify-self: end;
}

.tz-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  background: rgba(198, 201, 190, 0.08);
  text-transform: uppercase;
}

.tz-est {
  color: #7fd4ff;
  border-color: rgba(127, 212, 255, 0.55);
  box-shadow: 0 0 14px rgba(127, 212, 255, 0.25);
}

.tz-cst {
  color: #a5f3a1;
  border-color: rgba(165, 243, 161, 0.55);
  box-shadow: 0 0 14px rgba(165, 243, 161, 0.25);
}

.tz-mst {
  color: #ffc56f;
  border-color: rgba(255, 197, 111, 0.55);
  box-shadow: 0 0 14px rgba(255, 197, 111, 0.25);
}

.tz-pst {
  color: #ff8aa0;
  border-color: rgba(255, 138, 160, 0.55);
  box-shadow: 0 0 14px rgba(255, 138, 160, 0.25);
}

.tz-jst {
  color: #b79bff;
  border-color: rgba(183, 155, 255, 0.55);
  box-shadow: 0 0 14px rgba(183, 155, 255, 0.25);
}

.tz-aus {
  color: #ffe66d;
  border-color: rgba(255, 230, 109, 0.55);
  box-shadow: 0 0 14px rgba(255, 230, 109, 0.25);
}

.tz-euuk {
  color: #9ccae5;
  border-color: rgba(156, 202, 229, 0.55);
  box-shadow: 0 0 14px rgba(156, 202, 229, 0.25);
}

.tz-wibwita {
  color: #7dff9a;
  border-color: rgba(125, 255, 154, 0.55);
  box-shadow: 0 0 14px rgba(125, 255, 154, 0.25);
}

.tz-other,
.tz-unknown {
  color: rgba(198, 201, 190, 0.8);
  border-color: rgba(198, 201, 190, 0.3);
}

[x-cloak] {
  display: none !important;
}

.btn-edit {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  background: rgba(198, 201, 190, 0.12);
  border: 1px solid rgba(198, 201, 190, 0.3);
  color: var(--ash-grey);
}

.btn-edit:hover {
  background: rgba(198, 201, 190, 0.2);
}

.side-panel {
  position: fixed;
  right: 28px;
  top: 120px;
  width: 300px;
  max-width: calc(100vw - 56px);
  background: rgba(1, 8, 19, 0.95);
  border: 1px solid rgba(198, 201, 190, 0.18);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  padding: 16px;
  z-index: 20;
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.side-panel-body {
  display: grid;
  gap: 12px;
}

.panel-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  background: rgba(198, 201, 190, 0.06);
  border: 1px solid rgba(198, 201, 190, 0.1);
}

.panel-row form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.panel-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.panel-inline-stack {
  flex-direction: column;
  align-items: flex-start;
}

.panel-input {
  display: grid;
  gap: 4px;
  width: 100%;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(198, 201, 190, 0.2);
  background: rgba(198, 201, 190, 0.08);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.toggle-chip input {
  accent-color: #9ccae5;
}

.panel-label {
  font-weight: 600;
}

.panel-total {
  margin-left: auto;
  padding-right: 6px;
  color: rgba(198, 201, 190, 0.8);
}

.panel-footer {
  text-align: right;
}

.toggle-chip {
  padding: 2px 6px;
}
