.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 10px var(--space-page-x);
  background: var(--surface);
  border-bottom: 3px solid var(--primary);
  box-shadow: 0 1px 0 rgb(18 20 23 / 4%);
}

.brand-block {
  display: grid;
  gap: 2px;
  min-width: max-content;
}

.brand {
  color: var(--text);
  font-size: 1.03rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand:hover {
  color: var(--primary);
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.nav a,
.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 10px;
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-weight: 800;
}

.nav a:hover,
.link-button:hover {
  color: var(--primary);
  background: var(--primary-soft);
  text-decoration: none;
}

.nav-form {
  margin: 0;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--info-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.language-form {
  margin: 0;
}

.language-button {
  min-width: 32px;
  min-height: 30px;
  padding: 4px 8px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.language-button--active {
  color: #fff;
  background: var(--text);
  border-color: var(--text);
}

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

.link-button {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.page {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 28px var(--space-page-x) 56px;
}

.page-heading {
  margin-bottom: 18px;
}

.lead {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

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

.section-heading h2 {
  margin: 0;
  font-size: 1.08rem;
}

.panel,
.form-panel,
.match-row,
.table-wrap,
.admin-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgb(18 20 23 / 3%);
}

.panel,
.form-panel {
  padding: 20px;
}

.compact {
  margin-top: 16px;
}

.form-grid,
.grid {
  display: grid;
  gap: 16px;
}

.two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field {
  display: grid;
  gap: 6px;
}

label {
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
}

input:focus,
select:focus {
  border-color: var(--primary);
  outline: 3px solid var(--primary-soft);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  color: var(--text);
  background: var(--info-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button--primary {
  color: #fff;
  background: var(--action);
  border-color: var(--action-dark);
}

.button:hover {
  background: #e5eaf0;
  text-decoration: none;
}

.button--primary:hover {
  background: var(--action-dark);
}

.button--small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.92rem;
}

.button--disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.65;
}

.button--disabled:hover {
  background: var(--info-bg);
  text-decoration: none;
}

.button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.notice {
  margin-bottom: 16px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid;
  font-weight: 700;
  background: var(--info-bg);
  border-color: var(--line);
}

.notice--success {
  background: var(--success-bg);
  border-color: #8bd4aa;
}

.notice--error {
  background: var(--danger-bg);
  border-color: #f2a6a0;
  color: var(--danger);
}

.matchday-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.matchday-context-links {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  white-space: nowrap;
}

.matchday-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.matchday-select-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  flex: 1;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.matchday-select-form select {
  min-width: 0;
  min-height: 34px;
  padding-block: 5px;
  font-weight: 700;
}

.match-row {
  display: grid;
  gap: 10px;
  padding: 11px 14px 13px;
  border-left: 4px solid transparent;
}

.match-row--editable {
  border-left-color: var(--action);
}

.match-row--locked {
  background: var(--surface-raised);
}

.match-row--reopened {
  border-left-color: var(--warning);
}

.match-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.match-score-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.score-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.score-cell--away {
  justify-content: flex-end;
}

.score-cell input {
  width: 64px;
  min-height: 46px;
  padding: 8px;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 800;
}

.score-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.versus {
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 800;
}

.match-state {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.team-display {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}

.team-display--away {
  justify-content: flex-end;
}

.team-display span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-logo,
.team-logo-fallback {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
}

.team-logo {
  position: relative;
  margin-left: -32px;
  object-fit: contain;
  background: #fff;
}

.team-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--info-bg);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 800;
}

.kickoff,
.muted,
.hint {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.badge--success,
.badge--active {
  color: var(--success);
  background: var(--success-bg);
  border-color: #a9dfbd;
}

.badge--warning,
.badge--expired {
  color: var(--warning);
  background: var(--warning-bg);
  border-color: #f0cf7a;
}

.badge--revoked {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #f4aaa3;
}

.table-wrap {
  overflow-x: auto;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: var(--surface);
}

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

th {
  color: var(--muted);
  background: var(--surface-raised);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fff9f9;
}

.matrix-teams {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.empty {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .shell-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .brand-block {
    min-width: 0;
  }

  .nav {
    justify-content: flex-start;
    gap: 6px;
  }

  .nav a,
  .link-button {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 0.9rem;
  }

  .language-switcher {
    margin-left: 0;
  }

  .page {
    padding-top: 20px;
  }

  .matchday-switcher {
    align-items: stretch;
    flex-direction: column;
  }

  .matchday-select-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .matchday-switcher > .button {
    width: 100%;
  }

  .match-row {
    padding: 10px;
  }

  .match-row-header,
  .match-state {
    align-items: flex-start;
    flex-direction: column;
  }

  .match-row .kickoff {
    font-size: 0.9rem;
  }

  .match-score-grid {
    gap: 6px;
  }

  .score-cell {
    align-content: start;
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .score-cell--away {
    align-items: flex-end;
    justify-content: flex-end;
  }

  .score-cell--away input {
    order: 2;
  }

  .score-cell input {
    width: min(100%, 82px);
    min-height: 48px;
  }

  .team-display {
    max-width: 100%;
  }

  .team-display--away {
    text-align: right;
  }
}

@media (max-width: 480px) {
  .nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav a,
  .link-button,
  .nav-form,
  .language-switcher {
    width: 100%;
  }

  .nav-form {
    display: flex;
  }

  .link-button {
    justify-content: flex-start;
  }

  .language-switcher {
    justify-content: center;
  }

  .language-form {
    flex: 1;
  }

  .language-button {
    width: 100%;
  }

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

  .matchday-context-links {
    justify-content: flex-start;
    white-space: normal;
  }

  .team-logo,
  .team-logo-fallback {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .team-logo {
    margin-left: -30px;
  }

  .badge {
    font-size: 0.8rem;
  }
}
