/* CSS MODIFICADO - VERSIÓN 2025081801 - TEST CARGA */
:root { 
  --gap: 12px; 
  --azul-cian: #00bcd4;
  --verde-cargado: #4caf50;
  --rojo-parcial: #f48fb1;
  --gris-fondo: #e8e8e8;
  --gris-texto: #757575;
}

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

body { 
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; 
  background: var(--azul-cian); 
  color: #333;
  min-height: 100vh;
}

.container { 
  max-width: 600px; 
  margin: 0 auto; 
}

.header-section {
  background: var(--azul-cian);
  padding: 16px;
  text-align: left;
  border-bottom: 2px solid rgba(255,255,255,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-section h1 { 
  color: white;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.5px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-size: 0.9rem;
}

.logout-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 0.2s;
}

.logout-btn:hover {
  background: rgba(255,255,255,0.3);
}

@media (max-width: 480px) {
  .header-section {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  .user-info {
    flex-direction: column;
    gap: 6px;
  }
}

.escuela-nombre { 
  font-size: 1.3rem; 
  font-weight: 600; 
  color: white; 
  margin: 0; 
  padding: 16px; 
  background: var(--azul-cian); 
  text-align: center;
}

.status { 
  padding: 8px 16px; 
  color: #666; 
  background: white;
  text-align: center;
}

.mesas-container {
  background: white;
  min-height: calc(100vh - 140px);
}

.mesa-card {
  background: var(--gris-fondo);
  margin: 0 0 1px 0;
  padding: 0;
  border-bottom: 1px solid #ccc;
  cursor: pointer;
  min-height: 60px;
  /* Evitar selección de texto */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* Evitar highlight en touch */
  -webkit-tap-highlight-color: transparent;
}

/* Aplicar también a todos los elementos internos */
.mesa-card * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mesa-contenido {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 12px 16px;
}

.mesa-numero-container {
  flex: 0 0 auto;
  margin-right: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mesa-label {
  font-size: 0.9rem;
  color: var(--gris-texto);
  margin-bottom: 2px;
}

.mesa-numero {
  font-size: 2.5rem;
  font-weight: bold;
  color: #333;
  line-height: 1;
}

.mesa-estados {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mesa-estado {
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.85rem;
  text-align: center;
  flex: 1;
}

.estado-cargado {
  background: var(--verde-cargado);
  color: white;
}

.estado-no-cargado {
  background: var(--gris-fondo);
  color: var(--gris-texto);
  border: 1px solid #ccc;
}

.estado-parcial {
  background: var(--rojo-parcial);
  color: white;
}

.estado-enviado {
  background: var(--verde-cargado);
  color: white;
}

.estado-no-enviado {
  background: var(--gris-fondo);
  color: var(--gris-texto);
  border: 1px solid #ccc;
}

.mesa-card:hover {
  background: #ddd;
  transition: background-color 0.2s ease;
}

/* Estilos adicionales para elementos que puedan existir */
.panel { background:#fff; border-radius:8px; padding:12px; margin:16px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.form-grid .row { display:flex; align-items:center; gap: var(--gap); margin-bottom: var(--gap); }
.form-grid .row label { flex:1 1 auto; }
.form-grid .row input[type=number], .form-grid .row input[type=text], select { width:160px; padding:8px; border:1px solid #e5e7eb; border-radius:6px; }
button { padding:8px 12px; border:0; border-radius:6px; background:#2563eb; color:#fff; cursor:pointer; }
button:hover { background:#1d4ed8; }

/* Popup de notificaciones */
.popup-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px 30px;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 1000;
  min-width: 280px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.popup-notification.show {
  opacity: 1;
}

.popup-notification.success {
  background: #4caf50;
  color: white;
  border: 3px solid #2e7d32;
}

.popup-notification.error {
  background: #f44336;
  color: white;
  border: 3px solid #d32f2f;
}

.foto-slot { padding:6px 8px; border:1px dashed #e5e7eb; border-radius:6px; margin-bottom:8px; background:#fafafa; }
small { color:#6b7280; }
a { 
  color:#1d4ed8; 
  text-decoration: none; 
}

/* Estilos para la página de mesa */
.mesa-header-section {
  background: var(--azul-cian);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  min-height: 60px;
}

.user-info-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: white;
}

.logout-link {
  color: white !important;
  text-decoration: none !important;
  background: rgba(255,255,255,0.2);
  padding: 4px 8px;
  border-radius: 3px;
  transition: background-color 0.2s;
}

.logout-link:hover {
  background: rgba(255,255,255,0.3);
}

.back-button {
  color: white !important;
  text-decoration: none !important;
  margin-right: 20px;
  padding: 8px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
}

.back-arrow-img {
  width: 40px;
  height: 40px;
  filter: brightness(0) invert(1);
}

.back-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mesa-header-section h1 {
  flex: 1;
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
  color: white !important;
  text-decoration: none !important;
  line-height: 1.2;
  display: flex;
  align-items: center;
  margin-left: 0;
}

.categoria-section {
  background: var(--azul-cian);
  padding: 2px 16px 8px 16px;
  text-align: center;
  color: white;
}

.categoria-section p {
  margin: 0 0 8px 0;
  font-size: 1rem;
}

.categoria-section h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.votos-section {
  background: white;
  min-height: auto;
}

.form-votos {
  padding: 0;
}

.lista-card {
  background: white;
  margin: 0 0 1px 0;
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  min-height: 68px;
}

.lista-header h3 {
  margin: 0 0 4px 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
  line-height: 1.2;
}

.lista-agrupacion {
  margin: 0;
  font-size: 1rem;
  color: #666;
  font-weight: 400;
  line-height: 1.2;
}

.lista-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.lista-votos {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
}

.lista-votos span {
  font-size: 1rem;
  color: #666;
}

.votos-input {
  width: 100px;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  -webkit-appearance: none;
  -moz-appearance: textfield; /* Firefox */
  appearance: textfield; /* Estándar */
}

/* Ocultar flechitas en Chrome, Safari, Edge */
.votos-input::-webkit-outer-spin-button,
.votos-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.votos-input:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.total-section {
  background: white;
  padding: 0;
  text-align: left;
  border-top: 1px solid #e0e0e0;
  margin: 0;
}

.total-card {
  background: white;
  margin: 0 0 1px 0;
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  border-left: 16px solid #607d8b;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  min-height: 68px;
}

.total-header h3 {
  margin: 0 0 4px 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
  line-height: 1.2;
}

.total-subtitle {
  margin: 0;
  font-size: 1rem;
  color: #666;
  font-weight: 400;
  line-height: 1.2;
}

.total-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.total-votos {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
}

.total-votos span {
  font-size: 1rem;
  color: #666;
}



.guardar-section {
  background: var(--azul-cian);
  padding: 16px;
  margin: 0;
}

.btn-modificar {
  width: 100%;
  background: white;
  color: #333;
  border: none;
  border-radius: 25px;
  padding: 16px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-modificar:hover {
  background: #f0f0f0;
}

/* Estilos para sección de fotos */
.fotos-panel {
  background: white;
  padding: 16px;
  margin-top: 0;
}

.fotos-panel h2 {
  margin: 0 0 12px 0;
  font-size: 1.2rem;
  color: #333;
}

.upload-panel {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

.upload-panel summary {
  cursor: pointer;
  font-weight: 500;
  color: #666;
}

/* Estilos para los nuevos elementos de fotos */
.foto-slot {
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 12px;
  background: #fafafa;
}

.certificado-header {
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  font-size: 1rem;
}

.foto-buttons {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-foto {
  flex: 1;
  padding: 12px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--azul-cian);
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-foto:hover {
  background: #00acc1;
}

.foto-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.nombre-archivo {
  flex: 1;
  font-family: monospace;
  background: white;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-size: 0.85rem;
  color: #333;
}

.btn-ver {
  padding: 8px 12px;
  background: var(--verde-cargado);
  color: white;
  text-decoration: none;
  border: 0;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-ver:hover {
  background: #45a049;
}

.btn-cambiar {
  padding: 8px 12px;
  background: #ff9800;
  color: white;
  border: 0;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-cambiar:hover {
  background: #f57c00;
}

.panel { background:#fff; border-radius:8px; padding:12px; margin:16px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.form-grid .row { display:flex; align-items:center; gap: var(--gap); margin-bottom: var(--gap); }
.form-grid .row label { flex:1 1 auto; }
.form-grid .row input[type=number], .form-grid .row input[type=text], select { width:160px; padding:8px; border:1px solid #e5e7eb; border-radius:6px; }
button { padding:8px 12px; border:0; border-radius:6px; background:#2563eb; color:#fff; cursor:pointer; }
button:hover { background:#1d4ed8; }
.msg { margin-top:8px; color:#065f46; }
small { color:#6b7280; }
a { 
  color:#1d4ed8; 
  text-decoration: none; 
}
