/* ===============================
   SV POS 2.0 - UI Profesional
================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', sans-serif;
}

body {
  display: flex;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  height: 100vh;
}

/* ===== SIDEBAR ===== */

.sidebar {
  width: 230px;
  background: #0f172a;
  padding: 20px;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar h2 {
  margin-bottom: 30px;
  font-size: 18px;
}

.sidebar a {
  display: block;
  padding: 12px;
  margin-bottom: 8px;
  text-decoration: none;
  color: #94a3b8;
  border-radius: 8px;
  transition: 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
  background: #2563eb;
  color: #fff;
}

/* ===== MAIN WRAPPER ===== */

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ===== TOPBAR ===== */

.topbar {
  height: 60px;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.topbar .metrics span {
  margin-right: 25px;
  color: #22c55e;
  font-weight: 600;
}

.topbar .user {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ===== CONTENT ===== */

.content {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
}

/* ===== CARDS ===== */

.card {
  background: #1e293b;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* ===== BUTTONS ===== */

.btn {
  padding: 10px 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-success {
  background: #16a34a;
  color: #fff;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn:hover {
  opacity: 0.85;
}

/* ===== INPUTS ===== */

input, select {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #fff;
}

/* ===== FLEX UTIL ===== */

.flex {
  display: flex;
}

.space-between {
  justify-content: space-between;
}

.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.password-container {
  position: relative;
  width: 100%;
}

.password-container input {
  width: 100%;
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #94a3b8;
}

.toggle-password:hover {
  color: #fff;
}

/* ===== BOTON HEADER INVENTARIO ===== */

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* ===== MODAL ===== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #1e293b;
  padding: 25px;
  border-radius: 12px;
  width: 400px;
}

.modal.active {
  display: flex;
}

/* ===== LOGIN ESPECÍFICO ===== */

.logo-container img {
  max-width: 150px; /* Ajusta según el tamaño de tu logo */
  filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.4)); /* Le da un brillo azul sutil */
  margin-bottom: 10px;
}

.password-container {
  margin-bottom: 15px; /* Separación consistente con los otros inputs */
}

/* Para asegurar que el body del login centre todo */
body.login-page {
  justify-content: center;
  align-items: center;
}

/* ===== COMPONENTES DE VENTAS (NUEVOS) ===== */

.metodos-pago-container {
  display: flex;
  gap: 10px;
  margin: 15px 0;
}

.btn-metodo {
  flex: 1;
  padding: 10px;
  background: #0f172a; /* Fondo oscuro como tus inputs */
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-metodo:hover {
  border-color: #2563eb;
  color: #fff;
}

.btn-metodo.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

/* Estilo para el botón de descripción en la lista de productos */
.btn-info {
  background: #64748b;
  color: white;
  margin-right: 5px;
}

/* Contenedor de recibidos para animar su aparición */
#seccionRecibido {
  transition: all 0.3s ease;
  overflow: hidden;
}

/* ===============================
   RESPONSIVE - MENÚ HAMBURGUESA
================================= */

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

.sidebar-overlay.active {
  display: block;
}

@media (max-width: 860px) {
  body {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 230px;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrapper {
    width: 100%;
  }

  .menu-toggle {
    display: flex;
  }

  .topbar {
    padding: 0 15px;
  }

  .topbar .metrics {
    display: none; /* Se ocultan métricas del topbar en móvil para dar espacio */
  }

  .content {
    padding: 15px;
  }

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

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

  .modal-content {
    width: 92%;
    max-width: 92%;
    padding: 18px;
  }

  table {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: 1fr !important;
  }

  .topbar .user span {
    display: none; /* Oculta el nombre de usuario en pantallas muy chicas, deja solo el botón de salir */
  }
}