:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #e7edf5;
  --primary: #13b8a6;
  --primary-dark: #0f766e;
  --warning: #f97316;
  --danger: #e11d48;
  --shadow: 0 18px 42px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

button {
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 240px;
  background: #111827;
  color: #fff;
  padding: 24px 18px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 22px;
}

.brand-name {
  font-weight: 800;
  font-size: 18px;
}

.brand-subtitle {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

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

.nav-item {
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  text-align: left;
  padding: 0 14px;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.shell {
  margin-left: 240px;
  padding: 28px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

#pageHint {
  margin-top: 8px;
  color: var(--muted);
}

.top-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-action,
.ghost-action,
.icon-btn,
.link-btn {
  border: 0;
  border-radius: 8px;
  height: 40px;
  padding: 0 16px;
  font-weight: 700;
}

.primary-action {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(19, 184, 166, 0.18);
}

.ghost-action,
.icon-btn {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.link-btn {
  height: 34px;
  background: #eefdfa;
  color: var(--primary-dark);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric {
  min-height: 118px;
  padding: 20px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 18px;
  font-size: 30px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.panel {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  min-height: 64px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-head h2 {
  font-size: 18px;
}

.panel-note {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #f9fbfe;
}

td {
  font-size: 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.status.pending {
  background: #fff7ed;
  color: #ea580c;
}

.status.active {
  background: #e7fbf8;
  color: var(--primary-dark);
}

.status.done {
  background: #ecfdf3;
  color: #15803d;
}

.status.cancelled {
  background: #fff1f2;
  color: var(--danger);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.small-btn {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.danger-btn {
  color: var(--danger);
}

.hidden {
  display: none !important;
}

.admin-avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  display: inline-grid;
  place-items: center;
}

.avatar-fallback {
  background: #e7fbf8;
  color: var(--primary-dark);
  font-weight: 900;
}

.status-select {
  min-width: 110px;
}

.player-stack {
  padding: 10px 16px 18px;
  display: grid;
  gap: 10px;
}

.player-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.player-card strong {
  display: block;
}

.player-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  margin-bottom: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}

input,
select {
  height: 40px;
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  padding: 12px;
  resize: vertical;
}

.toolbar input {
  max-width: 320px;
}

.toolbar select {
  max-width: 160px;
}

.settings-panel {
  max-width: 720px;
  padding-bottom: 20px;
}

.settings-panel label,
.dialog-card label {
  display: grid;
  gap: 8px;
  padding: 0 20px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.settings-panel .primary-action {
  margin: 20px;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.32);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

.dialog-card {
  width: 460px;
  padding-bottom: 20px;
  background: #fff;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.close-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: #f2f4f7;
  font-size: 22px;
}

.full {
  width: calc(100% - 40px);
  margin: 20px 20px 0;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  min-width: 180px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  opacity: 0;
  transform: translateY(12px);
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .shell {
    margin-left: 0;
    padding: 18px;
  }

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

  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar input,
  .toolbar select {
    max-width: none;
  }
}
