/* ============================================================================
   FCS-GesCom · Federación Colombiana de Savate
   CSS puro (sin frameworks). Paleta tomada del logotipo FCS:
   azul #14297A · amarillo #FFCD00 · rojo #CE1126 · blanco
   ============================================================================ */
:root {
  --fcs-blue:       #14297a;
  --fcs-blue-dark:  #0d1c56;
  --fcs-blue-light: #e8ecf8;
  --fcs-yellow:     #ffcd00;
  --fcs-red:        #ce1126;
  --fcs-red-dark:   #a30d1e;
  --ink:            #1c2333;
  --muted:          #667085;
  --line:           #d9dee9;
  --bg:             #f4f6fb;
  --white:          #ffffff;
  --ok:             #1a7f37;
  --radius:         10px;
  --shadow:         0 2px 8px rgba(13, 28, 86, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

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

/* --- Cabecera / navegación -------------------------------------------------- */
.topbar {
  background: linear-gradient(90deg, var(--fcs-blue-dark), var(--fcs-blue));
  border-bottom: 4px solid var(--fcs-yellow);
  color: var(--white);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--white); }
.brand:hover { text-decoration: none; }
.brand img {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--fcs-yellow);
  background: var(--white);
}
.brand-title { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.brand-sub { font-size: .75rem; color: #ffd94d; }

.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  color: #e9edff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .9rem;
  white-space: nowrap;
}
.nav a:hover { background: rgba(255, 255, 255, .12); text-decoration: none; }
.nav a.active { background: var(--fcs-yellow); color: var(--fcs-blue-dark); font-weight: 600; }

.userbox { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.userbox .role-chip {
  background: var(--fcs-red);
  color: var(--white);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.userbox a { color: #ffd94d; }

/* --- Contenido ---------------------------------------------------------------- */
.container { max-width: 1200px; margin: 0 auto; padding: 22px 16px 60px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head h1 {
  font-size: 1.45rem;
  color: var(--fcs-blue-dark);
  border-left: 6px solid var(--fcs-yellow);
  padding-left: 12px;
}
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}
.card h2 {
  font-size: 1.05rem;
  color: var(--fcs-blue);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--fcs-blue-light);
}

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* --- Tarjetas de indicadores --------------------------------------------------- */
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--fcs-yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.stat .num { font-size: 1.9rem; font-weight: 700; color: var(--fcs-blue-dark); }
.stat .lbl { color: var(--muted); font-size: .85rem; }
.stat.red  { border-top-color: var(--fcs-red); }
.stat.blue { border-top-color: var(--fcs-blue); }

/* --- Tablas -------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; background: var(--white); }
.tbl th {
  background: var(--fcs-blue);
  color: var(--white);
  text-align: left;
  padding: 9px 10px;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:nth-child(even) td { background: #f7f9fd; }
.tbl tr:hover td { background: var(--fcs-blue-light); }
.tbl .num { text-align: center; }

/* --- Botones -------------------------------------------------------------------- */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  background: var(--fcs-blue);
  color: var(--white);
  text-decoration: none;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.15); text-decoration: none; }
.btn.yellow { background: var(--fcs-yellow); color: var(--fcs-blue-dark); }
.btn.red    { background: var(--fcs-red); }
.btn.ghost  { background: transparent; color: var(--fcs-blue); border: 1px solid var(--fcs-blue); }
.btn.sm     { padding: 4px 10px; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* --- Formularios ------------------------------------------------------------------ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--fcs-blue-dark); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .92rem;
  font-family: inherit;
  background: var(--white);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--fcs-yellow);
  border-color: var(--fcs-blue);
}
.form-actions { margin-top: 16px; display: flex; gap: 10px; }

/* --- Avisos -------------------------------------------------------------------------- */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .92rem; }
.flash.success { background: #e7f5ec; color: var(--ok); border: 1px solid #b5e0c5; }
.flash.error   { background: #fdebed; color: var(--fcs-red-dark); border: 1px solid #f5b8c0; }
.flash.info    { background: var(--fcs-blue-light); color: var(--fcs-blue-dark); border: 1px solid #c3cdf0; }

/* --- Chips / badges --------------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.badge.blue   { background: var(--fcs-blue-light); color: var(--fcs-blue-dark); }
.badge.yellow { background: #fff4c2; color: #7a6200; }
.badge.red    { background: #fdebed; color: var(--fcs-red-dark); }
.badge.green  { background: #e7f5ec; color: var(--ok); }
.badge.gray   { background: #eef0f4; color: var(--muted); }

/* --- Combates (esquinas) ------------------------------------------------------------------ */
.corner-red  { color: var(--fcs-red); font-weight: 600; }
.corner-blue { color: var(--fcs-blue); font-weight: 600; }
.winner { background: #fff4c2 !important; border-radius: 4px; padding: 1px 6px; }

.match-row input[type=number] { width: 58px; text-align: center; }
.match-row select { min-width: 90px; }

/* --- Poules ---------------------------------------------------------------------------------- */
.poule-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.poule-card header {
  background: var(--fcs-blue);
  color: var(--white);
  padding: 8px 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}
.poule-card header .badge { background: var(--fcs-yellow); color: var(--fcs-blue-dark); }
.poule-card ol { padding: 10px 12px 10px 32px; background: var(--white); }
.poule-card li { padding: 3px 0; }

/* --- Cuadro eliminatorio ------------------------------------------------------------------------ */
.bracket { display: flex; gap: 26px; overflow-x: auto; padding: 8px 4px; }
.round { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; min-width: 220px; }
.round h3 { text-align: center; font-size: .85rem; color: var(--fcs-blue); text-transform: uppercase; }
.node { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--white); box-shadow: var(--shadow); }
.node .side { display: flex; justify-content: space-between; padding: 6px 10px; font-size: .88rem; gap: 8px; }
.node .side.red  { border-left: 4px solid var(--fcs-red); }
.node .side.blue { border-left: 4px solid var(--fcs-blue); border-top: 1px solid var(--line); }
.node .side.win { background: #fff4c2; font-weight: 700; }
.node .side .score { font-weight: 700; }

/* --- Página pública en directo (QR) ------------------------------------------------------------------ */
.live-header {
  background: linear-gradient(135deg, var(--fcs-blue-dark), var(--fcs-blue) 60%, var(--fcs-red-dark));
  color: var(--white);
  padding: 18px 16px;
  text-align: center;
  border-bottom: 4px solid var(--fcs-yellow);
}
.live-header img { width: 74px; height: 74px; border-radius: 50%; border: 3px solid var(--fcs-yellow); object-fit: cover; }
.live-header h1 { font-size: 1.3rem; margin-top: 6px; }
.live-header p { color: #ffd94d; font-size: .9rem; }
.live-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--fcs-red); margin-right: 6px;
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.live-filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 14px; }
.live-filters select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: .9rem; }

/* --- Login --------------------------------------------------------------------------------------------- */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1000px 500px at 10% 0%, rgba(255, 205, 0, .25), transparent 55%),
    radial-gradient(900px 500px at 95% 100%, rgba(206, 17, 38, .28), transparent 55%),
    linear-gradient(160deg, var(--fcs-blue-dark), var(--fcs-blue));
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  width: 100%;
  max-width: 410px;
  overflow: hidden;
}
.login-card .head {
  background: var(--fcs-blue);
  border-bottom: 4px solid var(--fcs-yellow);
  text-align: center;
  padding: 24px 20px 18px;
  color: var(--white);
}
.login-card .head img {
  width: 92px; height: 92px;
  border-radius: 50%;
  border: 3px solid var(--fcs-yellow);
  object-fit: cover;
  background: var(--white);
}
.login-card .head h1 { font-size: 1.15rem; margin-top: 10px; }
.login-card .head p { font-size: .8rem; color: #ffd94d; }
.login-card form { padding: 24px; }
.login-card .btn { width: 100%; padding: 11px; font-size: 1rem; margin-top: 6px; }

/* --- Pie ------------------------------------------------------------------------------------------------- */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  padding: 18px;
  border-top: 1px solid var(--line);
  margin-top: 30px;
}
.footer .col { color: var(--fcs-blue); font-weight: 600; }

/* --- Utilidades -------------------------------------------------------------------------------------------- */
.muted { color: var(--muted); font-size: .85rem; }
.text-center { text-align: center; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

@media (max-width: 720px) {
  .nav { width: 100%; order: 3; }
  .page-head h1 { font-size: 1.2rem; }
}

@media print {
  .topbar, .footer, .page-head .actions, .no-print { display: none !important; }
  body { background: var(--white); }
  .card { box-shadow: none; border: none; }
}
