/* ===========================================
   Mundial 2026 – Estilos (Material Verde)
   SPA completa – Diseño limpio y moderno
   =========================================== */

:root {
  --bg: #eef4ef;             /* Fondo suave verde */
  --surface: #ffffff;        /* Tarjetas */
  --ink: #0f172a;            /* Texto principal */
  --muted: #475569;          /* Texto secundario */
  --primary: #16a34a;        /* Verde principal */
  --primary-ink: #0b3b1d;    /* Verde oscuro */
  --border: rgba(0,0,0,.12); /* Bordes suaves */
  --shadow: 0 8px 20px rgba(0,0,0,.06);
}

/* GLOBAL */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, Segoe UI, Roboto, Ubuntu, sans-serif;
}

/* ===========================================
   APP BAR SUPERIOR
   =========================================== */

.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .logo {
  font-size: 24px;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  color: var(--primary-ink);
}


/* ===========================================
   LAYOUT GENERAL: SIDEBAR + CONTENIDO
   =========================================== */

.layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 56px);
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 12px;
}

.nav-btn {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 15px;
}

.nav-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}

.main {
  padding: 16px;
}


/* ===========================================
   BOTONES / TOOLBAR
   =========================================== */

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.btn:hover {
  background: #138039;
}

.btn-tonal {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-tonal:hover {
  background: #f2f6f2;
}


/* ===========================================
   TARJETAS (CARDS)
   =========================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.mt { margin-top: 16px; }

.muted { color: var(--muted); }


/* ===========================================
   GRILLAS
   =========================================== */

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Config grid */
.grid-2 {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}


/* ===========================================
   GRUPOS: TABLAS, PARTIDOS, EDICIÓN
   =========================================== */

.group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.group-title {
  font-weight: 800;
  font-size: 18px;
  color: var(--primary-ink);
}

.team-edit {
  display: grid;
  grid-template-columns: 1fr 40px 40px 40px 40px 40px;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.team-edit input[type=text] {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
}

.match {
  display: grid;
  grid-template-columns: 1fr 70px 24px 70px 1fr;
  gap: 6px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 6px;
}

.match input[type=number] {
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  background: #fff;
}

.table {
  display: grid;
  gap: 6px;
}

.table .thead,
.table .row {
  display: grid;
  grid-template-columns: 2fr repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.table .thead {
  color: var(--muted);
  font-weight: 700;
}

.table .row {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
}


/* ===========================================
   RANKING DE TERCEROS
   =========================================== */

.terceros {
  margin: 0;
  padding-left: 18px;
}


/* ===========================================
   ELIMINATORIA: BRACKET
   =========================================== */

.bracket-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.round {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--shadow);
}

.br {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 10px;
}

.br-row {
  display: grid;
  grid-template-columns: 1fr 50px 24px 50px 1fr;
  align-items: center;
  gap: 6px;
}

.select-third {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 6px;
}

.br-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}


/* ===========================================
   TABS
   =========================================== */

.tab {
  display: none;
}

.tab.active {
  display: block;
}


/* ===========================================
   FOOTER
   =========================================== */

.footer {
  text-align: center;
  color: var(--muted);
  padding: 16px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* Celdas dentro de las filas/thead */
.table .thead > div,
.table .row > div {
  padding: 4px 6px;
  display: flex;
  align-items: center;
  min-height: 28px;
}

.table .thead > div {
  font-weight: 700;
  color: var(--muted);
}