/* ============================================================
   PráCMFP · Hoja de estilos principal
   ============================================================ */

:root {
  --azul-oscuro: #0769b2;
  --azul-medio:  #055d9e;
  --azul-claro:  #3ba3e8;
  --azul-bg:     #eef5fc;
  --azul-borde:  #b3d4f0;

  --club-bg:      #e8f0fb;
  --club-color:   #0769b2;
  --club-borde:   #b8c8f0;

  --terap-bg:     #faf0e8;
  --terap-color:  #7a3a0a;
  --terap-borde:  #e0c0a0;

  --amarillo-bg:  #fff8e8;
  --amarillo-borde:#e8d090;
  --amarillo-text:#7a5a10;

  --rojo:         #c04a3a;

  --surface:      #ffffff;
  --surface-alt:  #f7f7f5;
  --border:       #e4e2dc;
  --border-strong:#c8c6c0;

  --text:         #1a1a18;
  --text-sec:     #6a6a60;
  --text-muted:   #9a9a90;

  --radius:       8px;
  --radius-lg:    12px;
}

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

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ---- Topbar ---- */
.topbar {
  background: var(--azul-oscuro);
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar-logo {
  width: 30px; height: 30px;
  background: var(--azul-claro);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
}
.topbar-title { color: #fff; font-size: 14px; font-weight: 500; }
.topbar-sub   { color: rgba(255,255,255,.5); font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user  { color: rgba(255,255,255,.7); font-size: 13px; }
.topbar-logout {
  color: rgba(255,255,255,.5); font-size: 12px;
  text-decoration: none; padding: 4px 10px;
  border: 0.5px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
}
.topbar-logout:hover { color: #fff; border-color: rgba(255,255,255,.5); }

/* ---- Layout ---- */
.page-wrap { max-width: 960px; margin: 0 auto; padding: 28px 20px 60px; }
.page-wrap-wide { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
}
.card-header {
  padding: 14px 20px;
  border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h2 { font-size: 15px; font-weight: 500; }
.card-body { padding: 20px; }

/* ---- Stats row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.stat-val   { font-size: 22px; font-weight: 500; }
.stat-sub   { font-size: 11px; color: var(--text-sec); margin-top: 2px; }
.stat-ok    { color: #0769b2; }
.stat-warn  { color: #b07a10; }
.stat-danger{ color: var(--rojo); }

/* ---- Progreso de inscripción ---- */
.progress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.prog-card {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 0.5px solid var(--border);
}
.prog-card.completo { border-color: var(--azul-borde); background: var(--azul-bg); }
.prog-card.pendiente { border-color: var(--amarillo-borde); background: var(--amarillo-bg); }
.prog-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.prog-val   { font-size: 17px; font-weight: 500; }
.prog-val.ok   { color: #0769b2; }
.prog-val.pend { color: #b07a10; }
.prog-sub   { font-size: 10px; color: var(--text-sec); }

/* ---- Oferta cards ---- */
.oferta-list { display: flex; flex-direction: column; gap: 8px; }
.oferta-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
}
.oferta-card.inscripto { border-color: var(--azul-borde); background: var(--azul-bg); }
.oferta-card.lleno     { opacity: .6; }

.oferta-icono {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 17px;
}
.oferta-icono.nivel      { background: var(--azul-bg); color: #0769b2; }
.oferta-icono.club       { background: var(--club-bg);  color: var(--club-color); }
.oferta-icono.terapeutico{ background: var(--terap-bg); color: var(--terap-color); }

.oferta-info    { flex: 1; min-width: 0; }
.oferta-nombre  { font-size: 14px; font-weight: 500; word-break: break-word; }
.oferta-meta    { font-size: 12px; color: var(--text-sec); word-break: break-word; }
.oferta-cupo    { font-size: 11px; text-align: right; }
.cupo-ok        { color: #0769b2; }
.cupo-warn      { color: #b07a10; }
.cupo-lleno     { color: var(--rojo); }

/* ---- Badges / Tags ---- */
.tag {
  display: inline-block; font-size: 10px; font-weight: 500;
  padding: 2px 8px; border-radius: 20px;
}
.tag-nivel     { background: var(--azul-bg);  color: #055d9e; border: 0.5px solid var(--azul-borde); }
.tag-club      { background: var(--club-bg);   color: var(--club-color); border: 0.5px solid var(--club-borde); }
.tag-terapeutico{ background: var(--terap-bg); color: var(--terap-color); border: 0.5px solid var(--terap-borde); }
.tag-inicial   { background: #f0f8e8; color: #2a5a0a; border: 0.5px solid #b0d890; }
.tag-primario  { background: #e8f4fb; color: #0a4a7a; border: 0.5px solid #90c0e0; }
.tag-secundario{ background: #f5eafb; color: #5a0a8a; border: 0.5px solid #d0a0e8; }

/* ---- Botones ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 0.5px solid var(--border-strong);
  background: transparent; color: var(--text-sec);
  text-decoration: none; transition: background .15s;
}
.btn:hover { background: var(--surface-alt); }

.btn-primary {
  background: var(--azul-oscuro); color: #fff;
  border-color: var(--azul-oscuro);
}
.btn-primary:hover { background: var(--azul-medio); }

.btn-danger { border-color: #f0b0a0; color: var(--rojo); }
.btn-danger:hover { background: #fff0ee; }

.btn-block { width: 100%; justify-content: center; padding: 10px; font-size: 14px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ---- Formularios ---- */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--text-sec); margin-bottom: 5px;
}
.form-control {
  width: 100%; padding: 9px 12px;
  background: var(--surface); border: 0.5px solid var(--border-strong);
  border-radius: var(--radius); font-size: 14px; color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--azul-claro); box-shadow: 0 0 0 3px rgba(7,105,178,.15); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---- Alertas ---- */
.alert {
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert-success { background: var(--azul-bg); border: 0.5px solid var(--azul-borde); color: #055d9e; }
.alert-warning { background: var(--amarillo-bg); border: 0.5px solid var(--amarillo-borde); color: var(--amarillo-text); }
.alert-danger  { background: #fff0ee; border: 0.5px solid #f0b0a0; color: var(--rojo); }
.alert-info    { background: #e8f0fb; border: 0.5px solid #b8c8f0; color: #0769b2; }

/* ---- Tabla admin ---- */
.table-wrap { overflow-x: auto; }
table.data  { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11px; color: var(--text-muted);
  font-weight: 500; padding: 8px 12px;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface-alt);
  text-transform: uppercase; letter-spacing: .05em;
}
table.data td {
  padding: 10px 12px; border-bottom: 0.5px solid var(--border);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--surface-alt); }

/* Barra de cupo */
.cupo-bar-wrap { display: flex; align-items: center; gap: 8px; }
.cupo-bar-bg   { flex: 1; height: 4px; background: var(--border); border-radius: 2px; min-width: 60px; }
.cupo-bar-fill { height: 4px; border-radius: 2px; background: var(--azul-claro); }
.cupo-bar-fill.warn   { background: #d4a030; }
.cupo-bar-fill.danger { background: var(--rojo); }

/* ---- Login ---- */
.login-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: var(--surface-alt);
}
.login-box {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.login-header {
  background: var(--azul-oscuro);
  padding: 28px 28px 24px;
  text-align: center;
}
.login-logo {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--azul-claro);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff;
  margin: 0 auto 12px;
}
.login-header h1 { font-size: 18px; color: #fff; font-weight: 500; }
.login-header p  { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 4px; }
.login-body { padding: 24px 28px 28px; }

/* ---- Admin sidebar layout ---- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 200px; flex-shrink: 0;
  background: var(--azul-oscuro);
  padding: 16px 0;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
  transition: transform .25s ease;
  z-index: 200;
}
.admin-content { flex: 1; min-width: 0; }
.sb-logo { padding: 0 16px 16px; border-bottom: 0.5px solid rgba(255,255,255,.1); margin-bottom: 12px; }
.sb-logo h2 { color: #fff; font-size: 14px; font-weight: 500; white-space: nowrap; }
.sb-logo p  { color: rgba(255,255,255,.4); font-size: 11px; }
.sb-section { font-size: 10px; color: rgba(255,255,255,.35); padding: 8px 16px 4px; text-transform: uppercase; letter-spacing: .08em; }
.sb-link {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; font-size: 13px;
  color: rgba(255,255,255,.6); text-decoration: none;
}
.sb-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.sb-link.active { color: #fff; background: rgba(255,255,255,.1); border-left: 2px solid var(--azul-claro); }
.sb-link .ico { font-size: 15px; }
.sb-divider { height: 0.5px; background: rgba(255,255,255,.1); margin: 8px 0; }

/* Topbar mobile admin */
.admin-topbar-mobile {
  display: none;
  background: var(--azul-oscuro);
  padding: 0 16px;
  height: 50px;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.admin-topbar-mobile span { color: #fff; font-size: 14px; font-weight: 500; }
.btn-hamburger {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 5px; padding: 4px;
}
.btn-hamburger b {
  display: block; width: 22px; height: 2px;
  background: #fff; border-radius: 2px;
}
.sb-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}

@media (max-width: 700px) {
  .admin-layout { display: block; }
  .admin-content { width: 100%; display: block; }
  .page-wrap, .page-wrap-wide { padding: 16px 12px 40px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---- Filtros ---- */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab {
  font-size: 12px; padding: 5px 12px; border-radius: 20px;
  border: 0.5px solid var(--border-strong); color: var(--text-sec);
  cursor: pointer; background: var(--surface); text-decoration: none;
}
.filter-tab.active { background: var(--azul-oscuro); color: #fff; border-color: var(--azul-oscuro); }

/* ---- Misc ---- */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.gap-8 { display: flex; gap: 8px; }
.flex-end { display: flex; justify-content: flex-end; gap: 8px; }
