:root {
  color-scheme: dark;
  --bg: #101418;
  --surface: #171d22;
  --surface-2: #20282f;
  --surface-3: #10161b;
  --line: #31404b;
  --text: #edf3f7;
  --muted: #9fafb9;
  --green: #55b86a;
  --cyan: #5ab6d6;
  --amber: #d8a84f;
  --red: #df6a5b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  letter-spacing: 0;
}

button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}

button:hover {
  border-color: var(--cyan);
}

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

button.primary {
  background: #22564a;
  border-color: #347461;
}

.app {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - 30px);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #12181d;
  padding: 18px;
  overflow: auto;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #40775b;
  background: #17382e;
  border-radius: 6px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.brand span,
.match-meta,
.empty,
.section-head p {
  color: var(--muted);
}

.sidebar-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.summary-list {
  display: grid;
  gap: 8px;
}

.summary-item {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(0, 1.2fr);
  gap: 8px;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: var(--surface);
}

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

.summary-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.match-title {
  font-size: 19px;
  font-weight: 700;
}

.scoreboard {
  display: flex;
  gap: 10px;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

.scoreboard span {
  min-width: 96px;
  text-align: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-3);
}

.dashboard-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 340px;
}

.main-panel {
  min-width: 0;
  padding: 18px;
  overflow: auto;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.status {
  min-width: 92px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--muted);
  background: var(--surface-3);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

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

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 13px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.active {
  background: #1f3035;
}

td strong,
td b {
  display: block;
  font-size: 14px;
}

td span,
td small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.prob {
  display: grid;
  gap: 5px;
  min-width: 104px;
}

.prob > div {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #0b1014;
}

.prob i {
  display: block;
  height: 100%;
}

.prob i.home {
  background: var(--green);
}

.prob i.draw {
  background: var(--amber);
}

.prob i.away {
  background: var(--cyan);
}

.inspector {
  border-left: 1px solid var(--line);
  background: #12181d;
  padding: 14px;
  overflow: auto;
}

.panel {
  border-bottom: 1px solid var(--line);
  padding: 0 0 14px;
  margin-bottom: 14px;
}

.panel-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.kv {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(0, 1fr);
  gap: 7px 10px;
  font-size: 13px;
}

.kv div:nth-child(odd) {
  color: var(--muted);
}

.selection {
  font-size: 13px;
}

.recent-list {
  display: grid;
  gap: 8px;
}

.recent-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: var(--surface);
}

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

.recent-item strong {
  font-size: 13px;
  line-height: 1.35;
}

footer {
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #0c1115;
  font-size: 12px;
}

@media (max-width: 1120px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .inspector {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .scoreboard {
    flex-wrap: wrap;
  }

  .scoreboard span {
    flex: 1 1 120px;
  }
}
