* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #f8fafc;
}
aside {
  min-height: 100vh;
  padding: 24px;
  background: #111827;
  border-right: 1px solid rgba(255,255,255,.08);
}
aside h1 { margin: 0 0 8px; font-size: 1.35rem; }
aside p { color: #cbd5e1; margin-bottom: 24px; }
nav { display: grid; gap: 8px; margin-bottom: 24px; }
button, input, textarea, select {
  font: inherit;
  border-radius: 10px;
}
button {
  border: 1px solid rgba(255,255,255,.16);
  background: #15803d;
  color: white;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}
button:hover { background: #16a34a; }
button:disabled,
button.disabled-nav {
  opacity: .48;
  cursor: not-allowed;
}
button.disabled-nav:hover {
  background: rgba(255,255,255,.06);
}
nav button, #logoutBtn {
  background: rgba(255,255,255,.06);
  text-align: left;
}
dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  max-width: 460px;
  position: fixed;
  margin: 0;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
dialog::backdrop {
  background: transparent;
}
dialog.modal-dialog {
  max-width: 520px;
  width: min(520px, calc(100vw - 32px));
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
dialog.modal-dialog::backdrop {
  background: rgba(15,23,42,.72);
}
.dialog-card {
  background: #ffffff;
  color: #0f172a;
  padding: 22px;
  min-width: min(360px, calc(100vw - 32px));
}
.dialog-card h3 {
  margin-top: 0;
}
.dialog-card p {
  color: #475569;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
button.secondary {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}
button.secondary:hover {
  background: #cbd5e1;
}
main {
  width: min(1180px, calc(100vw - 320px));
  margin: 0 auto;
  padding: 42px 24px;
}
.hero {
  background: linear-gradient(135deg, #14532d, #16a34a);
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: 0 20px 55px rgba(0,0,0,.24);
}
.hero h2 { margin: 0 0 10px; color: white; }
.hero p { margin: 0; color: #dcfce7; }
h2 { margin-top: 0; font-size: 2rem; }
h3 { margin: 0 0 16px; }
.hidden { display: none; }
.grid.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.panel {
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}
.view > .toolbar + .panel {
  margin-bottom: 18px;
}
.view > .toolbar h2 {
  margin-bottom: 0;
}
.panel.compact { max-width: 520px; }
.notice {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  color: #92400e;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-weight: 700;
}
.notice button {
  margin-left: 10px;
  padding: 7px 10px;
}
.live-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
}
.live-link-row label {
  margin: 0;
}
.live-link-row input {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .9rem;
}
.compact-form {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}
.login-panel {
  max-width: 460px;
  margin: 0 auto;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
button.link-button {
  background: transparent;
  color: #14532d;
  border: 0;
  padding: 0;
  font-weight: 850;
}
button.link-button:hover {
  background: transparent;
  color: #16a34a;
  text-decoration: underline;
}
.public-mode {
  grid-template-columns: 1fr;
}
.public-mode aside {
  display: none;
}
.public-mode main {
  width: min(1180px, 100vw);
}
label { display: grid; gap: 6px; margin-bottom: 12px; font-weight: 800; color: #334155; }
input, textarea, select {
  width: 100%;
  border: 1px solid #cbd5e1;
  padding: 10px 12px;
  background: #f8fafc;
  color: #0f172a;
}
textarea { resize: vertical; }
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.platform-club-list {
  margin-top: 14px;
}
.club-card {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
}
.club-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.club-card-header strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 2px;
}
.club-card-header p {
  margin: 0;
}
.club-meta {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  color: #475569;
}
.switch-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #334155;
}
.switch-line input {
  width: auto;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.section-header h3 {
  margin-bottom: 4px;
}
.section-header p {
  margin: 0;
}
.member-form {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}
.compact-table {
  font-size: .94rem;
}
.compact-table th,
.compact-table td {
  vertical-align: middle;
}
.compact-table select {
  padding: 8px 10px;
}
.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #14532d;
  font-size: .82rem;
  font-weight: 850;
}
.badge.warning {
  background: #fef3c7;
  color: #92400e;
}
.list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.score-card, .playoff-match {
  background: #111827;
  color: #f8fafc;
  border: 1px solid rgba(148,163,184,.24);
  border-radius: 12px;
  padding: 14px;
}
.score-card h4 { margin: 0 0 10px; color: #22c55e; }
.score-card p { margin: 6px 0; }
.score-card b {
  color: #86efac;
  margin-right: 6px;
}
.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}
.score-row label { margin-bottom: 0; color: #e2e8f0; }
.score-row input { min-width: 70px; }
.playoff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.playoff-match {
  margin-bottom: 10px;
}
.winner {
  color: #86efac;
  font-weight: 800;
}
.inline {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}
.inline input { width: auto; }
.item {
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
}
.item header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.muted { color: #64748b; }
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  color: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 14px;
}
th, td {
  padding: 9px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}
th { background: #14532d; color: white; }
#message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 460px;
  background: #111827;
  border: 1px solid rgba(255,255,255,.16);
  padding: 12px 14px;
  border-radius: 12px;
}
#message:empty { display: none; }
@media (max-width: 860px) {
  body { grid-template-columns: 1fr; }
  aside { min-height: auto; }
  main { width: 100%; }
  .grid.two { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: 1fr; }
  .score-row { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
}
