:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #728096;
  --line: #dfe7f2;
  --brand: #20b89d;
  --brand-dark: #127e72;
  --brand-blue: #0d83d8;
  --brand-gold: #ffb41d;
  --warn: #e25f5f;
  --blue: #3d7bfd;
  --soft-blue: #e8f5ff;
  --soft-green: #e8fff4;
  --soft-gold: #fff6dc;
  --shadow: 0 18px 48px rgba(27, 59, 89, 0.1);
  font-family: Nunito, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(32, 184, 157, 0.14), transparent 32vw),
    linear-gradient(180deg, #f7fbff, #eef5f8);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
}

button:hover {
  background: var(--brand-dark);
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 42px;
  background:
    linear-gradient(90deg, rgba(8, 49, 64, 0.42), rgba(244, 247, 251, 0.72) 48%, rgba(244, 247, 251, 0.95)),
    url("./assets/login-artwork-web.jpg") center / cover no-repeat;
}

.login-card {
  display: grid;
  width: min(980px, 100%);
  min-height: 560px;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.85fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 28px 80px rgba(10, 47, 63, 0.24);
}

.login-art {
  display: flex;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(12, 96, 136, 0.15), rgba(8, 67, 74, 0.82)),
    url("./assets/login-artwork-web.jpg") center / cover no-repeat;
}

.login-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 64, 66, 0.34));
  pointer-events: none;
}

.login-logo,
.login-art-copy {
  position: relative;
  z-index: 1;
}

.login-logo {
  width: min(210px, 48%);
  height: auto;
  align-self: flex-start;
  filter: drop-shadow(0 14px 24px rgba(3, 50, 75, 0.3));
}

.login-art-copy {
  max-width: 420px;
}

.login-art-copy .eyebrow {
  color: #fef5c7;
}

.login-art-copy h1 {
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 900;
  line-height: 0.92;
}

.login-art-copy p:last-child {
  max-width: 320px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
  line-height: 1.45;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  background: var(--panel);
}

.login-panel h2 {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0;
}

.login-intro {
  margin: 10px 0 26px;
  color: var(--muted);
  line-height: 1.45;
}

.login-panel input {
  border-color: #cfe0f1;
  padding: 14px 16px;
  background: #f8fbff;
}

.login-panel input:focus {
  border-color: var(--brand-blue);
  outline: 3px solid rgba(13, 131, 216, 0.15);
}

.login-panel button[type="submit"] {
  padding: 15px 18px;
  border-radius: 10px;
  color: #073d54;
  background: linear-gradient(90deg, var(--brand-gold), #ffd95f);
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(255, 180, 29, 0.24);
}

.login-panel button[type="submit"]:hover {
  background: linear-gradient(90deg, #ffa51d, #ffcf45);
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

.admin-view {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(4, 84, 110, 0.92), rgba(10, 47, 63, 0.98)),
    url("./assets/login-artwork-web.jpg") center / cover no-repeat;
  color: #fff;
  box-shadow: 12px 0 34px rgba(10, 47, 63, 0.12);
}

.sidebar .eyebrow {
  color: #f9d96b;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.sidebar-brand img {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(2, 31, 43, 0.2));
}

.sidebar h1 {
  font-size: 26px;
  font-weight: 900;
}

.sidebar nav {
  display: grid;
  gap: 10px;
  margin-top: 32px;
}

.nav-button,
.ghost-button {
  border-radius: 12px;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
  text-align: left;
  font-weight: 800;
}

.nav-button.active,
.nav-button:hover,
.ghost-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.nav-button.active {
  color: #073d54;
  background: linear-gradient(90deg, #ffd75b, #ffb41d);
}

.content {
  min-width: 0;
  padding: 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  padding: 18px 20px;
  border: 1px solid rgba(223, 231, 242, 0.84);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 34px rgba(38, 73, 101, 0.07);
  backdrop-filter: blur(10px);
}

.topbar h2 {
  font-size: 34px;
  font-weight: 900;
}

.topbar .ghost-button {
  color: var(--ink);
  background: #eef6ff;
}

.topbar .ghost-button:hover {
  background: #dceeff;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-card,
.panel {
  border: 1px solid rgba(223, 231, 242, 0.92);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  display: grid;
  gap: 8px;
  overflow: hidden;
  min-height: 140px;
  padding: 22px;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -44px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: rgba(32, 184, 157, 0.14);
}

.metric-card:nth-child(1) {
  background: linear-gradient(135deg, #ffffff, var(--soft-blue));
}

.metric-card:nth-child(2) {
  background: linear-gradient(135deg, #ffffff, var(--soft-green));
}

.metric-card:nth-child(3) {
  background: linear-gradient(135deg, #ffffff, var(--soft-gold));
}

.metric-card:nth-child(4) {
  background: linear-gradient(135deg, #ffffff, #eef0ff);
}

.metric-card span {
  color: var(--muted);
  font-weight: 800;
}

.metric-card strong {
  position: relative;
  z-index: 1;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0;
}

.wide {
  grid-column: 1 / -1;
}

.panel {
  min-height: 220px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.panel-header h3 {
  font-size: 20px;
  font-weight: 900;
}

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

.table,
.players-list {
  display: grid;
}

.table-row,
.player-row {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.table-row {
  grid-template-columns: 46px 44px 1fr 110px 90px;
}

.player-row {
  grid-template-columns: 44px 1fr auto;
  text-align: left;
  color: var(--ink);
  background: #fff;
  border-radius: 0;
}

.top-player-row {
  width: 100%;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  color: var(--ink);
  background: #fff;
  border-radius: 0;
}

.top-player-row:hover,
.player-row:hover {
  background: #f0f8ff;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #d8dee8, #f2f6fb);
  box-shadow: 0 6px 14px rgba(25, 64, 90, 0.12);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(223, 231, 242, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 34px rgba(38, 73, 101, 0.07);
}

.search-row input {
  border-color: transparent;
  background: #f5f9fd;
}

.search-row button {
  border-radius: 12px;
  background: var(--brand-blue);
  font-weight: 900;
}

.search-row button:hover {
  background: #066fb8;
}

.players-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(420px, 1.2fr);
  gap: 16px;
}

.players-list {
  max-height: calc(100vh - 210px);
  overflow: auto;
}

.player-details {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-item {
  padding: 14px;
  border: 1px solid #e3ebf4;
  border-radius: 12px;
  background: #fbfdff;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-item strong {
  display: block;
  margin-top: 3px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

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

.error-text {
  min-height: 20px;
  color: var(--warn);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 20px;
  background: #fbfdff;
}

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

.pager button {
  min-width: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--brand-blue);
  font-weight: 900;
}

.danger-text {
  color: var(--warn);
}

.danger-button {
  background: var(--warn);
}

.danger-button:hover {
  background: #b93f3f;
}

.secondary-button {
  color: var(--ink);
  background: #e7eef8;
}

.secondary-button:hover {
  background: #d6e1f0;
}

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

.modal-backdrop {
  display: grid;
  position: fixed;
  inset: 0;
  z-index: 10;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 39, 0.55);
}

.modal-panel {
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(8, 13, 24, 0.26);
}

.modal-copy {
  color: var(--muted);
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

@media (max-width: 920px) {
  .admin-view,
  .players-layout,
  .login-card {
    grid-template-columns: 1fr;
  }

  .login-view {
    padding: 22px;
  }

  .login-card {
    min-height: 0;
  }

  .login-art {
    min-height: 300px;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-brand {
    max-width: 360px;
  }

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

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

@media (max-width: 560px) {
  .section-grid,
  .detail-grid,
  .search-row {
    grid-template-columns: 1fr;
  }

  .login-view {
    padding: 14px;
  }

  .login-art {
    min-height: 240px;
    padding: 24px;
  }

  .login-logo {
    width: 150px;
  }

  .login-panel {
    padding: 28px 22px;
  }

  .login-panel h2 {
    font-size: 32px;
  }

  .content {
    padding: 18px;
  }

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

  .topbar .ghost-button {
    width: 100%;
    text-align: center;
  }

  .table-row {
    grid-template-columns: 36px 40px 1fr;
  }

  .top-player-row span:nth-of-type(2),
  .top-player-row span:nth-of-type(3) {
    display: none;
  }
}
