/* Quiniela Caja - Estilos personalizados */

/* Variables de color */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
}

/* Tipografía base */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-800);
}

/* Números con formato de moneda */
.monto-positivo { color: var(--success); font-weight: 600; }
.monto-negativo { color: var(--danger); font-weight: 600; }
.monto-neutro   { color: var(--gray-700); font-weight: 600; }

/* Cards */
.card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 1.25rem;
}

/* Badges de estado */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green   { background: #dcfce7; color: #166534; }
.badge-red     { background: #fee2e2; color: #991b1b; }
.badge-yellow  { background: #fef9c3; color: #854d0e; }
.badge-blue    { background: #dbeafe; color: #1e40af; }
.badge-gray    { background: #f3f4f6; color: #374151; }

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary  { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled)  { background: var(--primary-dark); }
.btn-success  { background: var(--success); color: white; }
.btn-success:hover:not(:disabled)  { background: #15803d; }
.btn-danger   { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled)   { background: #b91c1c; }
.btn-ghost    { background: transparent; color: var(--gray-600); border: 1px solid var(--gray-200); }
.btn-ghost:hover:not(:disabled)    { background: var(--gray-100); }
.btn-sm       { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-lg       { padding: 0.7rem 1.4rem; font-size: 1rem; }
.btn-full     { width: 100%; }

/* Inputs */
.input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
  background: white;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.input-error { border-color: var(--danger); }

label.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Tabla */
.tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.tabla th {
  background: var(--gray-50);
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--gray-200);
}
.tabla td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.tabla tr:last-child td { border-bottom: none; }
.tabla tr:hover td { background: var(--gray-50); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 1rem;
  }
}
.modal-box {
  background: white;
  border-radius: 1rem 1rem 0 0;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
}
@media (min-width: 640px) {
  .modal-box {
    border-radius: 1rem;
    max-width: 480px;
    max-height: 85vh;
  }
}

/* Navbar */
.navbar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 1rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}
.navbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  text-decoration: none;
}

/* Contenedor principal */
.container {
  max-width: 768px;
  margin: 0 auto;
  padding: 1rem;
}

/* Bottom nav (mobile) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid var(--gray-200);
  display: flex;
  z-index: 40;
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0;
  color: var(--gray-600);
  font-size: 0.7rem;
  text-decoration: none;
  transition: color 0.15s;
}
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a svg { width: 22px; height: 22px; margin-bottom: 2px; }

/* Resumen de caja */
.resumen-linea {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
}
.resumen-linea:last-child { border-bottom: none; }
.resumen-linea.total {
  font-weight: 700;
  font-size: 1rem;
  border-top: 2px solid var(--gray-200);
  padding-top: 0.6rem;
  margin-top: 0.2rem;
}
.resumen-linea.ok    { background: #dcfce7; border-radius: 0.5rem; padding: 0.5rem 0.75rem; margin-top: 0.5rem; }
.resumen-linea.error { background: #fee2e2; border-radius: 0.5rem; padding: 0.5rem 0.75rem; margin-top: 0.5rem; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(79,70,229,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast notification */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
}
.toast-msg {
  background: var(--gray-800);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.toast-msg.show { opacity: 1; }
.toast-msg.success { background: var(--success); }
.toast-msg.error   { background: var(--danger); }

/* Página de login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

/* Colores para tipos de movimiento */
.tipo-transferencia   { color: #2563eb; }
.tipo-cuenta_corriente { color: #7c3aed; }
.tipo-tesoro          { color: #d97706; }
.tipo-otro_producto   { color: #059669; }
.tipo-premio_otra_agencia { color: #dc2626; }
.tipo-otro            { color: #6b7280; }
