/**
 * WK Poule — Dynamis-achtige huisstijl (zodiac, tangerine, pistache, lochmara)
 */

:root {
  --color-primary: #162340;
  --color-primary-soft: #2a3651;
  --color-accent: #f18700;
  --color-accent-hover: #d97700;
  --color-success: #72c314;
  --color-info: #0082ca;
  --color-bg: #f9f7f4;
  --color-card: #ffffff;
  --color-muted: #5c6473;
  --color-border: #dadad3;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(10, 27, 57, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html {
  height: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--color-bg);
  color: #1a1f2b;
  line-height: 1.55;
}

a {
  color: var(--color-info);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--color-site-header-bg, #162340);
  color: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  flex-wrap: wrap;
}

.site-header__brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 1 1 auto;
  min-width: 0;
}

.site-header__menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.site-header__menu-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.site-header__menu-toggle-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 1.2rem;
}

.site-header__menu-toggle-bar {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header--nav-open .site-header__menu-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header--nav-open .site-header__menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-header--nav-open .site-header__menu-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-header__menus {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0;
}

.site-header__inner--sub {
  padding-top: 0.5rem;
  padding-bottom: 0.65rem;
  justify-content: flex-start;
}

.site-header__nav-cluster {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem 0.75rem;
  min-width: 0;
}

.site-header__subnav {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
}
.brand:hover {
  text-decoration: none;
  opacity: 0.9;
}

.brand__logo {
  max-height: 50px;
  width: auto;
}

/* Donkere “pill”-nav (referentie: moderne horizontale menubalk) */
.nav-shell {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.nav-shell--primary {
  flex: 0 1 auto;
}

.nav-shell--deelnemer-solo {
  flex: 1 1 auto;
  min-width: 0;
}

.site-header__nav-cluster--participant .nav-shell--deelnemer-solo .nav--tier2 {
  font-size: 0.9rem;
}

.site-header__nav-cluster--participant .nav--tier2 .nav__link {
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
}

.nav-shell--account {
  flex: 0 0 auto;
}

.nav-shell--secondary {
  flex: 1 1 100%;
  justify-content: flex-start;
  max-width: 100%;
}

.nav-shell--secondary .nav--tier2 {
  justify-content: flex-start;
}

.nav--main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0.35rem 0.45rem;
  list-style: none;
  background: #2A3651;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.nav__link:hover {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.nav__link.is-active {
  color: #fff;
  text-decoration: none;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.nav__link--cta {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.nav__link--cta:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.45);
}

.nav__link--muted {
  color: rgba(255, 255, 255, 0.65);
}

.nav__link--muted:hover {
  color: rgba(255, 255, 255, 0.9);
}

button.nav__link.nav__tab {
  font: inherit;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

button.nav__link.nav__tab:focus-visible {
  outline: 2px solid var(--color-accent, #f18700);
  outline-offset: 2px;
}

.nav--tier2 .nav__link {
  font-size: 0.86rem;
  padding: 0.45rem 0.8rem;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.hero {
  background: linear-gradient(135deg, #f9f7f4 0%, #ffffff 100%);
  border-radius: var(--radius);
  padding: 2.25rem 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--color-primary);
}

.hero p {
  margin: 0 0 1.25rem;
  color: var(--color-muted);
  max-width: 52ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 720px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.card h2,
.card h3 {
  margin-top: 0;
  color: var(--color-primary);
}

.stat {
  text-align: left;
}
.stat__value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-accent);
}
.stat__label {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #f18700 0%, #f19d00 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(241, 135, 0, 0.35);
}
.btn-primary:hover {
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover {
  color: var(--color-primary);
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.btn-ghost:hover {
  color: #fff;
  border-color: #fff;
}

.btn-danger {
  background: #a32020;
  color: #fff;
}

.input,
select.input,
textarea.input {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font: inherit;
  margin-bottom: 0.85rem;
  background: #fff;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-primary-soft);
  margin-bottom: 0.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th,
td {
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
}
th {
  color: var(--color-primary);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge--ok {
  background: rgba(114, 195, 20, 0.15);
  color: #3a7a0a;
}
.badge--warn {
  background: rgba(241, 135, 0, 0.15);
  color: #a85a00;
}
.badge--muted {
  background: #edece8;
  color: var(--color-muted);
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.alert-success {
  background: rgba(114, 195, 20, 0.12);
  border: 1px solid rgba(114, 195, 20, 0.35);
  color: #2d5c08;
}
.alert-error {
  background: rgba(163, 32, 32, 0.08);
  border: 1px solid rgba(163, 32, 32, 0.25);
  color: #7a1818;
}

.text-muted {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.tabs a {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.88rem;
}
.tabs a.is-active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  text-decoration: none;
}

.league-table .rank-num {
  font-weight: 700;
  color: var(--color-accent);
  width: 2.5rem;
}

.site-footer {
  padding: 1.25rem 1rem;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.site-footer__left,
.site-footer__right {
  min-width: 0;
}

.site-footer__left {
  text-align: left;
}

.site-footer__right {
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-footer__right {
    text-align: left;
    white-space: normal;
  }
}

.setup-page {
  background: var(--color-bg);
}

h1.page-title {
  color: var(--color-primary);
  margin-top: 0;
}

pre.log-tail {
  background: #0a1b39;
  color: #edeae8;
  padding: 1rem;
  border-radius: var(--radius);
  overflow: auto;
  max-height: 320px;
  font-size: 0.78rem;
}

/* --- v1.1 responsive & extra componenten --- */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
}

.table-responsive--matches .matches-table {
  min-width: 520px;
}

/* Scroll-anker na opslaan voorspelling: rij blijft onder de header zichtbaar */
tr[id^="pred-row-"],
tr[id^="pred-hub-"],
tr[id^="pred-ov-"] {
  scroll-margin-top: 5.5rem;
}

.matches-table__col-date {
  white-space: normal;
  vertical-align: top;
  min-width: 5.5rem;
}

.match-date-stack__day {
  display: block;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.3;
}

.match-date-stack__time {
  display: block;
  font-size: 0.82rem;
  color: var(--color-muted);
  margin-top: 0.15rem;
}

.manager-match-edit__grid {
  display: grid;
  grid-template-columns: minmax(6.5rem, 9rem) minmax(11rem, 1fr) auto;
  gap: 1rem 1.25rem;
  align-items: center;
}

.manager-match-edit__teams strong {
  font-size: 1rem;
}

.manager-match-edit__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

@media (max-width: 719px) {
  .manager-match-edit__grid {
    grid-template-columns: 1fr;
  }
  .manager-match-edit__controls {
    width: 100%;
  }
}

.matches-table__actions {
  white-space: nowrap;
  vertical-align: middle;
}

.matches-table__actions .btn {
  margin-right: 0.35rem;
  margin-bottom: 0.2rem;
}

.matches-table__pred-cell {
  vertical-align: middle;
  min-width: 6.5rem;
}

/* Voorkom dat <form> de tabelcel-layout breekt (inputs blijven in de voorspellingskolom) */
.matches-table__pred-cell .js-pred-form:not([hidden]) {
  display: contents;
}

.matches-table__pred-inputs {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
  vertical-align: middle;
}

.matches-table__pred-input {
  width: 3rem !important;
  max-width: 3.5rem !important;
  min-width: 2.5rem;
  margin-bottom: 0 !important;
  padding: 0.25rem 0.35rem !important;
  text-align: center;
}

.matches-table__pred-dash {
  font-weight: 700;
  color: var(--color-primary);
}

.matches-table__pred-cell .js-pred-form[hidden] {
  display: none !important;
}

/* Wedstrijden: op smalle schermen één subtiele “kaart” per wedstrijd (zelfde markup als tabel) */
@media (max-width: 768px) {
  .table-responsive--matches.table-responsive {
    overflow: visible;
    margin: 0;
    padding: 0;
  }

  .table-responsive--matches .matches-table {
    min-width: 0 !important;
    width: 100%;
    display: block;
    border-collapse: separate;
    border-spacing: 0;
  }

  .table-responsive--matches .matches-table thead {
    display: none;
  }

  .table-responsive--matches tbody.match-table-block {
    display: block;
    margin-bottom: 0.65rem;
  }

  .table-responsive--matches tr.matches-table__data-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.35rem 0.75rem;
    padding: 0.8rem 0.95rem;
    background: #fafaf8;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(10, 27, 57, 0.05);
  }

  .table-responsive--matches tr.matches-table__data-row > td {
    padding: 0;
    border: none;
    vertical-align: top;
  }

  .table-responsive--matches .matches-table__col-date {
    flex: 1 1 8rem;
    min-width: 0;
    order: 1;
  }

  .table-responsive--matches .matches-table__col-status {
    flex: 0 0 auto;
    order: 2;
    margin-left: auto;
    align-self: flex-start;
  }

  .table-responsive--matches .matches-table__col-match {
    flex: 1 0 100%;
    order: 3;
  }

  .table-responsive--matches .matches-table__col-stadium {
    flex: 1 0 100%;
    order: 4;
    font-size: 0.88rem;
  }

  .table-responsive--matches .matches-table__pred-cell {
    flex: 1 0 100%;
    order: 5;
  }

  .table-responsive--matches .matches-table__actions {
    flex: 1 0 100%;
    order: 6;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .hide-narrow {
    display: none;
  }
}

@media (max-width: 900px) {
  .site-header__inner {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
  }

  .site-header__brand-row {
    flex: 0 0 auto;
    width: 100%;
  }

  .site-header__menu-toggle {
    display: inline-flex;
    flex-shrink: 0;
  }

  .site-header__menus {
    display: none;
    width: 100%;
    padding-top: 0.75rem;
    margin-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    gap: 0.75rem;
  }

  .site-header--nav-open .site-header__menus {
    display: flex;
  }

  .site-header__nav-cluster {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-shell,
  .nav-shell--primary,
  .nav-shell--account,
  .nav-shell--secondary {
    width: 100%;
    justify-content: stretch;
  }

  .nav-shell--secondary .nav--tier2 {
    justify-content: flex-start;
  }

  .nav--main {
    width: 100%;
    overflow-x: visible;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.35rem 0.45rem;
    justify-content: flex-start;
  }
}

@media (min-width: 901px) {
  .site-header__inner {
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .site-header__brand-row {
    flex: 0 0 auto;
  }

  .site-header__menus {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  main {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .hero {
    padding: 1.5rem 1.25rem;
  }
  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 900px) {
  .workflow-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .admin-scoring-grid,
  .backup-grid,
  .stadium-detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.workflow-section h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.workflow-list {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
}

.workflow-list li {
  margin-bottom: 0.65rem;
}

.lead {
  font-size: 1.08rem;
  color: var(--color-muted);
  margin-top: 0;
}

.stadium-facts {
  margin: 0;
}
.stadium-facts dt {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--color-primary);
  margin-top: 0.65rem;
}
.stadium-facts dt:first-child {
  margin-top: 0;
}
.stadium-facts dd {
  margin: 0.15rem 0 0;
}

.stadium-hero__img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.info-block {
  margin-top: 1.25rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(0, 130, 202, 0.06) 0%, rgba(22, 35, 64, 0.04) 100%);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.info-block h3 {
  margin-top: 0;
  font-size: 1rem;
  color: var(--color-info);
}

.stadium-card__img-wrap {
  margin: -0.25rem -0.35rem 0.85rem;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  max-height: 160px;
}
.stadium-card__img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.team-card__title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0;
}

.team-card__flag {
  flex-shrink: 0;
  width: auto;
  height: 1.65rem;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.team-card__flag--lg {
  height: 2.25rem;
}

@media (min-width: 720px) {
  .stadium-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Poules-pagina --- */

.poules-grid {
  gap: 1.25rem;
}

.poule-block__title,
.poule-schema-block__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--color-primary);
}

.poule-schema-block__title {
  margin-bottom: 0.5rem;
}

.poule-block {
  margin-bottom: 0;
}

.poule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.poule-table th,
.poule-table td {
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--color-border);
}

.poule-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

.poule-table__rank {
  width: 2rem;
  text-align: center;
  font-weight: 700;
  color: var(--color-accent);
}

.poule-table__num {
  text-align: center;
  white-space: nowrap;
}

.poule-table--schema td:nth-child(3) {
  min-width: 10rem;
}

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