:root {
  color-scheme: light;
  --bg: #f3f4ec;
  --panel: #ffffff;
  --ink: #172019;
  --muted: #5a6358;
  --accent: #0d6b4f;
  --accent-2: #f2b705;
  --danger: #a93628;
  --border: #d8ddcf;
  --shadow: 0 20px 55px rgb(23 32 25 / 12%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #dff4df, transparent 35%), var(--bg);
  color: var(--ink);
}

button, input, select { font: inherit; }

button {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1rem;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

button:disabled { cursor: not-allowed; opacity: 0.55; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

input, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  background: #fff;
}

label { display: grid; gap: 0.4rem; font-weight: 700; }

.hidden { display: none !important; }

.app-shell { min-height: 100vh; }

.login-card {
  width: min(92vw, 420px);
  margin: 8vh auto;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 22px;
  color: var(--ink);
  background: var(--accent-2);
  font-size: 2rem;
}

.login-card h1 { margin-bottom: 0.3rem; }
.login-card p { color: var(--muted); }
.form-stack { display: grid; gap: 1rem; margin-top: 1.5rem; }
.hint { font-size: 0.9rem; }
.message { min-height: 1.5rem; color: var(--danger); font-weight: 700; }
.message.success { color: var(--accent); }

.dashboard {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
.dashboard.sidebar-collapsed { grid-template-columns: 1fr; }
.dashboard.sidebar-collapsed .sidebar { display: none; }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  background: #102119;
  color: #fff;
}

.sidebar-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-weight: 900;
  font-size: 1.1rem;
}
.sidebar-collapse-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: #d9eee6;
  background: rgb(255 255 255 / 10%);
  border-radius: 6px;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover { background: rgb(255 255 255 / 20%); }
.sidebar-user {
  padding: 0.75rem;
  background: rgb(255 255 255 / 8%);
  border-radius: 10px;
}
.sidebar-user .eyebrow { color: #a0c4b1; }
.sidebar-user h3,
.sidebar-username { margin: 0.2rem 0 0.6rem; font-size: 0.95rem; color: #fff; font-weight: 700; }
.sidebar-logout { width: 100%; justify-content: center; font-size: 0.85rem; padding: 0.4rem 0.75rem; }

.menu { display: grid; gap: 0.6rem; }
.menu button {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  color: #d9eee6;
  background: transparent;
  text-align: left;
}
.menu button.active, .menu button:hover { background: rgb(255 255 255 / 12%); }
.logout {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  width: auto;
  background: var(--danger);
  color: #fff;
  white-space: nowrap;
}
.logout:hover { filter: brightness(0.95); }

.content { padding: 2rem; overflow-x: hidden; }
.content-tools {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.layout-restore-button { display: none; background: #41514a; }
.dashboard.sidebar-collapsed #showSidebarButton { display: inline-flex; }
.eyebrow { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.filters, .form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 0.8rem;
}
.form-grid { grid-template-columns: repeat(4, minmax(140px, 1fr)); align-items: end; }
.filter-clear-button { justify-content: center; }
.audit-filters { margin-bottom: 1rem; }

.panel, .match-card, .rule-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 12px 34px rgb(23 32 25 / 8%);
}
.panel { padding: 1rem; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.match-card { padding: 1.2rem; }
.match-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.9rem; }
.teams { display: grid; gap: 0.4rem; margin: 1rem 0; font-size: 1.1rem; font-weight: 900; }
.score { color: var(--accent); }
.status { display: inline-flex; border-radius: 999px; padding: 0.3rem 0.65rem; background: #edf5ef; color: var(--accent); font-weight: 800; }
.fixture-status { margin-top: 0.75rem; }
.scheduled-status { color: var(--muted); background: #eef0eb; }
.live-status { color: #fff; background: #c62828; }
.final-status { color: #fff; background: #16834f; }
.venue { margin: 0.35rem 0; color: var(--muted); }
.muted-text { color: var(--muted); }
.locked { color: var(--danger); font-weight: 800; }
.prediction-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.6rem; align-items: end; }
.fixture-update-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.fixture-score-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
.fixture-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: end;
}
.fixture-update-form button { white-space: nowrap; }

.table-wrap { overflow-x: auto; }
.users-panel { margin-top: 1rem; }
.users-panel h3 { margin-top: 0; }
.prize-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) 2fr;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1.25rem;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(135deg, #102119, #0d6b4f 55%, #f2b705);
  box-shadow: 0 18px 45px rgb(13 107 79 / 22%);
}
.prize-hero strong {
  display: block;
  margin: 0.3rem 0;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1;
}
.prize-hero p { margin: 0; color: rgb(255 255 255 / 78%); }
.prize-panel .eyebrow { color: rgb(255 255 255 / 72%); }
.prize-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.prize-split article {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 22px;
  background: rgb(255 255 255 / 14%);
  backdrop-filter: blur(8px);
}
.prize-split span { color: rgb(255 255 255 / 76%); font-weight: 800; }
.prize-split strong { font-size: 1.7rem; }
.prize-split small { color: rgb(255 255 255 / 82%); font-weight: 800; }
.prize-edit-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 0.75rem;
  align-items: end;
  padding-top: 1rem;
  border-top: 1px solid rgb(255 255 255 / 20%);
}
.prize-edit-form input { border: 0; }
.prize-edit-form button { background: #102119; white-space: nowrap; }
.standings-detail { margin-top: 1rem; }
.detail-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.detail-heading h3, .detail-heading p { margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.9rem; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); }
.actions-cell { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.secondary-button, .danger-button { padding: 0.45rem 0.75rem; }
.secondary-button { background: #41514a; }
.danger-button { background: var(--danger); }
.inactive-status { color: var(--danger); background: #fff1ef; }
.locked-status { color: #b45309; background: #fef3c7; }
.blocked-status { color: #fff; background: var(--danger); font-weight: 700; }

.rules-list { display: grid; gap: 1rem; margin-top: 1rem; }
.rule-card { padding: 1rem; border-left: 6px solid var(--accent-2); }
.rule-card h3 { margin: 0 0 0.3rem; }
.rule-card p { margin: 0; color: var(--muted); }

@media (max-width: 820px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .content { padding: 1rem; }
  .section-heading, .detail-heading { align-items: stretch; flex-direction: column; }
  .prize-panel, .prize-split, .prize-edit-form, .filters, .form-grid, .prediction-form, .fixture-score-row, .fixture-status-row { grid-template-columns: 1fr; }
}
