*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee9;
  --panel: #ffffff;
  --page: #eef2f7;
  --primary: #0f766e;
  --primary-strong: #115e59;
  --accent: #b42318;
}

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

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2.2rem;
  line-height: 1.1;
}

h2 {
  margin-bottom: 4px;
  font-size: 1rem;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.actions {
  display: grid;
  grid-template-columns: auto minmax(130px, 190px) auto auto;
  align-items: center;
  gap: 8px;
}

.actions label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
}

button {
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 10px 14px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--primary-strong);
}

button.secondary {
  color: var(--primary);
  background: #ffffff;
}

button.secondary:hover {
  color: #ffffff;
  background: var(--primary-strong);
}

.overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.metric,
.group-panel,
.match-row,
.stat-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  font-size: 1.9rem;
  font-weight: 850;
}

.metric small {
  color: var(--muted);
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 20px;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.group-panel {
  overflow: hidden;
}

.group-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.group-panel header h2,
.group-panel header span {
  margin: 0;
}

.group-panel header span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

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

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid #edf1f6;
  font-size: 0.88rem;
  text-align: right;
}

th:first-child,
td:first-child {
  width: 52%;
  text-align: left;
}

tbody tr:last-child td {
  border-bottom: 0;
}

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

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

.match-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 44px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px;
}

.match-row time,
.match-row small {
  color: var(--muted);
  font-size: 0.78rem;
}

.match-row small {
  grid-column: 2 / -1;
}

.score {
  border-radius: 999px;
  padding: 4px 6px;
  color: #ffffff;
  background: #344054;
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

.stats {
  display: grid;
  gap: 10px;
}

.stat-block {
  padding: 14px;
}

.stat-block p {
  margin-bottom: 0;
}

.stat-block ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat-block li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 0.88rem;
}

.stat-block li span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .topbar,
  .layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

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

@media (max-width: 720px) {
  .app-shell {
    padding: 16px;
  }

  .overview,
  .groups,
  .actions {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

  .match-row {
    grid-template-columns: 76px minmax(0, 1fr) 42px minmax(0, 1fr);
  }
}
