/* =========================
   SISTEMA DE BINGO
   ========================= */

:root {
  --primary: #EC4E70;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #222;
  --muted: #777;
  --border: #e6e6e6;
  --success: #14a44d;
  --warning: #f6c343;
  --danger: #d93025;
  --blue: #2f80ed;
  --page-width: 8.5in;
  --page-height: 11in;
  --card-width: 3.6in;
  --card-height: 4.6in;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
    height:100%;
 min-height:100vh;
    display:flex;
    flex-direction:column;
}

.app-header {
  background: linear-gradient(135deg, var(--primary), #ff8ca5);
  color: white;
  padding: 20px 18px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.app-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.app-header p {
  margin: 0;
  opacity: 0.95;
}

.user-box {
  background: rgba(255,255,255,0.18);
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.user-box a {
  color: white;
  font-weight: bold;
  text-decoration: underline;
}

.container {
  width: min(1200px, 94%);
  margin: 24px auto;
  flex:1;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tab-btn {
  border: 0;
  background: white;
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.panel,
.partida-card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);
  margin-bottom: 18px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  align-items: end;
}

label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 6px;
  color: #333;
}

input,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  background: white;
}

input[type="color"] {
  padding: 4px;
  height: 45px;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(236, 78, 112, 0.15);
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.2s ease;
}

.btn:hover {
  opacity: 0.92;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-dark {
  background: #222;
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-warning {
  background: var(--warning);
  color: #222;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-blue {
  background: var(--blue);
  color: white;
}

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

.current-game {
  background: #97A5CC;
  border-left: 5px solid var(--primary);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  background: white;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.06);
  border-left: 5px solid var(--primary);
}

.summary-card strong {
  display: block;
  font-size: 24px;
  margin-bottom: 4px;
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
}

.partidas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.partida-card.active {
  border: 2px solid var(--primary);
}

.partida-card h3 {
  margin: 0 0 8px;
}

.partida-meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.cards-grid,
.preview-area {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  align-items: start;
}

.preview-area {
  max-width: 420px;
}

.bingo-card {
  --card-primary: var(--primary);
  --card-text: #222;
  --card-center: #97A5CC;
  background: white;
  color: var(--card-text);
  width: min(100%, var(--card-width));
  min-height: var(--card-height);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 2px solid transparent;
  position: relative;
  justify-self: center;
  display: flex;
  flex-direction: column;
}

.bingo-card.winner {
  border-color: var(--success);
  box-shadow: 0 0 0 4px rgba(20, 164, 77, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
}

.bingo-title {
  background: var(--card-primary);
  color: white;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  padding: 10px;
  min-height: 42px;
  letter-spacing: 0.4px;
}

.winner-badge {
  position: absolute;
  top: 52px;
  right: 8px;
  background: var(--success);
  color: white;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  z-index: 3;
}

.bingo-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  flex: 1;
}

.bingo-table th {
  background: var(--card-primary);
  color: white;
  padding: 8px;
  font-size: 18px;
}

.bingo-table td {
  border: 1px solid var(--border);
  text-align: center;
  padding: 12px 4px;
  font-weight: bold;
  font-size: 17px;
  background: #fff;
  position: relative;
}

.bingo-table td.marked {
  background: #d8f5e2;
  color: var(--success);
}

.bingo-table td.marked::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 5px;
  font-size: 12px;
}

.bingo-table td.free {
  background: var(--card-center);
  color: var(--card-primary);
}

.center-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  min-width: 22px;
}

.center-estrella .center-inner::before {
  content: "★";
  display: block;
  font-size: 25px;
  line-height: 1;
}

.center-circulo .center-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-primary);
  color: white;
  font-size: 11px;
}

.center-corazon .center-inner::before {
  content: "♥";
  display: block;
  font-size: 27px;
  line-height: 1;
}

.center-estrella .center-text,
.center-corazon .center-text {
  display: none;
}

.card-footer {
  padding: 10px;
  min-height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fafafa;
  border-top: 1px dashed #999;
}

.card-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #222;
  color: white;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.called-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.called-number {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.winner-list {
  display: grid;
  gap: 10px;
}

.winner-item {
  background: #eefaf2;
  border-left: 5px solid var(--success);
  padding: 12px;
  border-radius: 12px;
  font-weight: bold;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: #fff;
}

.notice {
  background: #fff7df;
  border-left: 5px solid var(--warning);
  padding: 12px 14px;
  border-radius: 12px;
  margin-top: 12px;
  color: #6a4b00;
}

.print-area {
  display: grid;
  gap: 22px;
  overflow-x: auto;
  padding-bottom: 20px;
}

.print-page {
  width: var(--page-width);
  min-height: var(--page-height);
  background: white;
  margin: 0 auto 22px;
  padding: 0.35in;
  display: grid;
  gap: 0.25in;
  position: relative;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.14);
  overflow: visible;
}

.print-page.grid-1 {
  grid-template-columns: 1fr;
}

.print-page.grid-2 {
  grid-template-columns: 1fr;
}

.print-page.grid-4 {
  grid-template-columns: repeat(2, 1fr);
}

.print-page.grid-6 {
  grid-template-columns: repeat(2, 1fr);
}

.print-page .bingo-card {
  width: var(--card-width);
  min-height: var(--card-height);
  max-width: 100%;
  box-shadow: none;
  border: 1px solid #333;
  border-radius: 8px;
  page-break-inside: avoid;
  justify-self: center;
  align-self: center;
}

.print-page .bingo-title {
  font-size: 15px;
  padding: 8px;
}

.print-page .bingo-table th {
  font-size: 16px;
  padding: 6px;
}

.print-page .bingo-table td {
  padding: 8px 3px;
  font-size: 15px;
}

.print-page .card-footer {
  min-height: 38px;
  padding: 7px;
}

.print-page .card-number {
  font-size: 12px;
  padding: 6px 13px;
}

.cut-mark {
  position: absolute;
  background: #111;
  z-index: 20;
  pointer-events: none;
}

.cut-h {
  width: 0.32in;
  height: 1px;
}

.cut-v {
  width: 1px;
  height: 0.32in;
}

.cut-top-left-h { top: 0.18in; left: -0.02in; }
.cut-top-left-v { top: -0.02in; left: 0.18in; }

.cut-top-right-h { top: 0.18in; right: -0.02in; }
.cut-top-right-v { top: -0.02in; right: 0.18in; }

.cut-bottom-left-h { bottom: 0.18in; left: -0.02in; }
.cut-bottom-left-v { bottom: -0.02in; left: 0.18in; }

.cut-bottom-right-h { bottom: 0.18in; right: -0.02in; }
.cut-bottom-right-v { bottom: -0.02in; right: 0.18in; }

.cut-mid-top { top: -0.02in; left: 50%; transform: translateX(-50%); width: 1px; height: 0.32in; }
.cut-mid-bottom { bottom: -0.02in; left: 50%; transform: translateX(-50%); width: 1px; height: 0.32in; }
.cut-mid-left { left: -0.02in; top: 50%; transform: translateY(-50%); width: 0.32in; height: 1px; }
.cut-mid-right { right: -0.02in; top: 50%; transform: translateY(-50%); width: 0.32in; height: 1px; }

.print-page.guides.grid-4::before,
.print-page.guides.grid-6::before {
  content: "";
  position: absolute;
  top: 0.35in;
  bottom: 0.35in;
  left: 50%;
  border-left: 1px dashed #999;
  pointer-events: none;
}

.print-page.guides.grid-4::after {
  content: "";
  position: absolute;
  left: 0.35in;
  right: 0.35in;
  top: 50%;
  border-top: 1px dashed #999;
  pointer-events: none;
}

.print-page.guides.grid-6 .row-guide-1,
.print-page.guides.grid-6 .row-guide-2 {
  position: absolute;
  left: 0.35in;
  right: 0.35in;
  border-top: 1px dashed #999;
  pointer-events: none;
}

.print-page.guides.grid-6 .row-guide-1 {
  top: 33.333%;
}

.print-page.guides.grid-6 .row-guide-2 {
  top: 66.666%;
}

/* Login */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #284378, #5EA5D8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-logo{
    text-align:center;
    margin-bottom:20px;
}

.login-logo img{
    width:90px;
    height:auto;
    object-fit:contain;
}

.auth-container {
  width: min(420px, 100%);
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.18);
}

.auth-card h1 {
  margin: 0 0 8px;
}

.auth-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tab {
  border: 0;
  padding: 12px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  background: #f0f0f0;
}

.auth-tab.active {
  background: var(--primary);
  color: white;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: grid;
  gap: 12px;
}

.auth-error,
.auth-success {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  font-weight: bold;
}

.auth-error {
  background: #ffe7e7;
  color: #9b1c1c;
}

.auth-success {
  background: #e8f9ed;
  color: #136d35;
}

@media (max-width: 700px) {
  .app-header h1 {
    font-size: 23px;
  }

  .container {
    width: 95%;
    margin: 16px auto;
  }

  .tab-btn {
    flex: 1 1 135px;
    padding: 11px;
  }

  .grid-form {
    grid-template-columns: 1fr;
  }

  .actions .btn {
    flex: 1 1 140px;
  }

  .cards-grid,
  .preview-area,
  .partidas-grid {
    grid-template-columns: 1fr;
  }

  .bingo-card {
    width: 100%;
    min-height: auto;
  }

  .print-page {
    width: 100%;
    min-height: auto;
    padding: 14px;
  }

  .print-page.grid-4,
  .print-page.grid-6 {
    grid-template-columns: 1fr;
  }

  .cut-mark {
    display: none;
  }
}

@page {
  size: var(--print-page-size, letter);
  margin: 0;
}

@media print {
  .app-header,
  .tabs,
  .panel.no-print,
  .summary,
  .actions {
    display: none !important;
  }

  body {
    background: white;
  }

  .container {
    width: 100%;
    margin: 0;
  }

  .tab-content {
    display: none !important;
  }

  #imprimir {
    display: block !important;
  }

  .print-area {
    gap: 0;
    overflow: visible;
    padding: 0;
  }

  .print-page {
    width: var(--page-width) !important;
    min-height: var(--page-height) !important;
    margin: 0;
    box-shadow: none;
    page-break-after: always;
  }

  .print-page:last-child {
    page-break-after: auto;
  }

  .print-page .bingo-card {
    break-inside: avoid;
  }
}


/* =========================
   LOGO + FOOTER
   ========================= */

.logo-area{
  display:flex;
  align-items:center;
  gap:18px;
  flex-wrap:wrap;
}

.main-logo{
  width:80px;
  height:auto;
  object-fit:contain;
}

.title-area h1{
  margin:0;
}

.main-footer{
  margin-top:40px;
  padding:20px;
  text-align:center;
  background:#111;
  color:white;
  font-weight:bold;
}

@media(max-width:700px){

  .logo-area{
    flex-direction:column;
    text-align:center;
  }

  .main-logo{
    width:65px;
  }

}


/* =========================
   NUEVO HEADER MODERNO
   ========================= */

:root{
  --primary:#263D71;
  --primary-light:#38569c;
}

.modern-header{
  background:white;
  border-bottom:1px solid #e8e8e8;
  padding:14px 24px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  position:sticky;
  top:0;
  z-index:999;
  box-shadow:0 2px 12px rgba(0,0,0,0.05);
}

.header-left{
  display:flex;
  align-items:center;
  gap:40px;
  flex-wrap:wrap;
}

.brand-area{
  display:flex;
  align-items:center;
  gap:14px;
}

.main-logo{
  width:62px;
  height:auto;
}

.brand-text h1{
  margin:0;
  font-size:24px;
  color:#263D71;
  font-weight:900;
  letter-spacing:1px;
}

.brand-text span{
  font-size:12px;
  color:#7f8aa3;
  font-weight:600;
}

.modern-nav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.nav-item{
  background:transparent;
  border:none;
  padding:12px 16px;
  border-radius:12px;
  cursor:pointer;
  color:#263D71;
  font-weight:700;
  transition:0.2s;
}

.nav-item:hover{
  background:#edf2ff;
}

.nav-item.active{
  background:#263D71;
  color:white;
}

.header-right{
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
}

.new-game-btn{
  background:#263D71;
  color:white;
  border:none;
  border-radius:12px;
  padding:12px 18px;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 4px 14px rgba(38,61,113,0.25);
}

.user-menu{
  display:flex;
  align-items:center;
  gap:12px;
  background:#f4f6fb;
  padding:10px 14px;
  border-radius:12px;
  font-weight:700;
}

.user-menu a{
  color:#263D71;
  text-decoration:none;
}

/* =========================
   FOOTER NUEVO
   ========================= */

.main-footer{
  margin-top:60px;
  background:linear-gradient(135deg,#263D71,#1d2f58);
  position:relative;
  overflow:hidden;
}

.footer-overlay{
  padding:40px 20px;
  backdrop-filter:blur(4px);
}

.footer-content{
  max-width:1200px;
  margin:auto;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:20px;
  text-align:center;
  flex-wrap:wrap;
  color:white;
}

.footer-logo{
  width:70px;
  height:auto;
  opacity:0.95;
}

.footer-content h3{
  margin:0 0 6px;
  font-size:22px;
}

.footer-content p{
  margin:0;
  opacity:0.85;
}

/* =========================
   COLORES GENERALES
   ========================= */

.btn-primary,
.tab-btn.active,
.called-number,
.bingo-title,
.bingo-table th{
  background:#263D71 !important;
}

.current-game{
  border-left-color:#97A5CC;
}

.summary-card{
  border-left-color:#263D71;
}

.partida-card.active{
  border-color:#263D71;
}

@media(max-width:900px){

  .modern-header{
    flex-direction:column;
    align-items:flex-start;
  }

  .header-left{
    width:100%;
    flex-direction:column;
    align-items:flex-start;
    gap:18px;
  }

  .modern-nav{
    width:100%;
  }

  .nav-item{
    flex:1 1 120px;
  }

  .header-right{
    width:100%;
    justify-content:space-between;
  }

}



/* =====================================================
   HEADER CORREGIDO - BYRON VEGA
   ===================================================== */

:root{
  --primary:#263D71 !important;
  --primary-light:#36579d;
}

.bv-top-header{
  width:100%;
  background:#ffffff;
  border-bottom:1px solid #e9edf5;
  padding:12px 28px;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:20px;
  position:sticky;
  top:0;
  z-index:9999;
  box-shadow:0 3px 18px rgba(38,61,113,0.08);
}

.bv-brand{
  display:flex !important;
  align-items:center !important;
  gap:14px;
  min-width:0;
}

.bv-logo{
  width:58px !important;
  height:58px !important;
  max-width:58px !important;
  max-height:58px !important;
  object-fit:contain !important;
  display:block !important;
  flex:0 0 58px;
}

.bv-brand-text{
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.bv-brand-text h1{
  margin:0;
  font-size:22px;
  line-height:1;
  color:#263D71;
  font-weight:900;
  letter-spacing:0.8px;
}

.bv-brand-text p{
  margin:5px 0 0;
  font-size:12px;
  color:#667085;
  font-weight:600;
}

.bv-header-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.bv-new-btn{
  background:#263D71;
  color:#fff;
  border:0;
  border-radius:12px;
  padding:12px 18px;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 5px 16px rgba(38,61,113,0.24);
}

.bv-user-menu{
  display:flex;
  align-items:center;
  gap:10px;
  background:#f4f6fb;
  border:1px solid #e4e8f0;
  padding:10px 14px;
  border-radius:12px;
  color:#263D71;
  font-weight:800;
}

.bv-user-menu a{
  color:#263D71;
  text-decoration:none;
  font-weight:800;
}

.bv-user-menu a:hover{
  text-decoration:underline;
}

/* Evita que estilos anteriores dañen el header */
.modern-header,
.app-header{
  display:none !important;
}

/* Footer profesional */
.bv-footer{
  margin-top:60px;
  background:linear-gradient(135deg,#263D71,#18284d);
  color:white;
}

.bv-footer-inner{
  max-width:1200px;
  margin:auto;
  padding:15px 15px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:18px;
  text-align:left;
}

.bv-footer-logo{
  width:56px;
  height:56px;
  object-fit:contain;
  filter:drop-shadow(0 4px 10px rgba(0,0,0,0.22));
}

.bv-footer-inner div{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.bv-footer-inner strong{
  font-size:18px;
}

.bv-footer-inner span{
  opacity:0.88;
}

/* Color global del sistema */
.btn-primary,
.tab-btn.active,
.called-number,
.bingo-title,
.bingo-table th{
  background:#263D71 !important;
}

.current-game,
.summary-card{
  border-left-color:#97A5CC !important;
}

.partida-card.active{
  border-color:#263D71 !important;
}

input:focus,
select:focus{
  border-color:#263D71 !important;
  box-shadow:0 0 0 3px rgba(38,61,113,0.15) !important;
}

@media(max-width:760px){
  .bv-top-header{
    padding:12px 16px;
    flex-direction:column;
    align-items:flex-start !important;
  }

  .bv-brand{
    width:100%;
  }

  .bv-logo{
    width:48px !important;
    height:48px !important;
    max-width:48px !important;
    max-height:48px !important;
    flex-basis:48px;
  }

  .bv-brand-text h1{
    font-size:19px;
  }

  .bv-header-actions{
    width:100%;
  }

  .bv-new-btn,
  .bv-user-menu{
    flex:1 1 auto;
    justify-content:center;
  }

  .bv-footer-inner{
    flex-direction:column;
    text-align:center;
  }
}
