:root {
  --primary: #0052FF;
  --primary-hover: #0043D1;
  --accent: #00D2FF;
  --bg-dark: #0A1128;
  --bg-card: #FFFFFF;
  --bg-surface: #F4F6FB;
  --text-main: #1C2536;
  --text-muted: #6C737F;
  --border-color: #E5E7EB;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow: 0 10px 25px -5px rgba(0, 82, 255, 0.1);
  --danger: #EF4444;
  --warning: #F59E0B;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-surface);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* MANEJO Y CONTROL DE PANTALLAS (VISTAS) */
.view-screen {
  min-height: calc(100vh - 80px);
  flex: 1;
}

#loginView {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #101E4A 100%);
  padding: 40px 20px;
}



/* LOGO DE LA CABECERA */
.logo {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
}

.logo span {
  color: var(--accent);
}

/* SPLIT LOGIN (PANTALLA DIVIDIDA) */
.login-wrapper {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 30px;
  width: 100%;
  max-width: 950px;
}

.login-card {
  background: var(--bg-card);
  padding: 35px 25px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  text-align: center;
}

.brand-badge {
  display: inline-block;
  background: rgba(0, 82, 255, 0.12);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.role-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background-color: white;
  outline: none;
}

.login-info-panel {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-images-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
}

.info-image-box {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-text-box {
  background: rgba(0, 82, 255, 0.15);
  border: 1px solid rgba(0, 210, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  color: #FFFFFF;
}

.info-text-box h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.info-text-box p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #E2E8F0;
}

/* ESTILOS DE FORMULARIO Y BOTONES */
.form-group {
  text-align: left;
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
}

.btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-secondary {
  background-color: rgba(0, 82, 255, 0.08);
  color: var(--primary);
}

.btn-full {
  width: 100%;
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  margin-left: 10px;
}

/* ENCABEZADO Y PERFIL DE USUARIO */
.app-header {
  background-color: var(--bg-dark);
  color: white;
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.user-pill {
  font-size: 0.9rem;
  background: rgba(255,255,255,0.1);
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-role {
  background-color: var(--primary);
  color: white;
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

/* CONTENEDOR PRINCIPAL Y MENÚ DE PRODUCTOS */
.main-container {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-admin-add {
  background-color: #10B981;
  color: white;
}

.subtitle {
  color: var(--text-muted);
}

.products-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  width: 100%;
}

.product-image {
  width: 90px;
  height: 90px;
  min-width: 90px;
  min-height: 90px;
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  flex-grow: 1;
}

.product-info h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.product-info .description {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.combo-selector {
  margin-bottom: 14px;
}

.switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-surface);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.switch-label input {
  display: none;
}

.slider {
  width: 36px;
  height: 20px;
  background-color: #CBD5E1;
  border-radius: 20px;
  position: relative;
  transition: 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: white;
  top: 2px;
  left: 2px;
  transition: 0.3s;
}

.switch-label input:checked + .slider {
  background-color: var(--primary);
}

.switch-label input:checked + .slider::before {
  transform: translateX(16px);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

/* ACCIONES Y BOTONES DE ADMINISTRACIÓN */
.action-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-edit {
  background-color: var(--warning);
  color: white;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-delete {
  background-color: var(--danger);
  color: white;
  padding: 8px 14px;
  font-size: 0.85rem;
}

/* CARRITO Y CÓDIGO QR (PANEL LATERAL DERECHO) */
.cart-summary {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 90px;
}

.summary-card, .qr-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  width: 100%;
}

.cart-list {
  list-style: none;
  min-height: 80px;
  max-height: 250px;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-color);
}

.empty-msg {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding-top: 20px;
}

.summary-divider {
  height: 1px;
  background: var(--border-color);
  margin: 16px 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.total-row {
  font-size: 1.2rem;
  font-weight: 700;
}

.qr-container {
  width: 100%;
  height: 180px;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.qr-placeholder {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

.qr-container img {
  width: 100%;
  height: 100%;
  max-width: 160px;
  max-height: 160px;
  object-fit: contain;
}

.qr-status-text {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
}

/* ESTILOS DEL MODAL (CREAR / EDITAR) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 17, 40, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: white;
  padding: 30px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 450px;
}

.modal-card h3 {
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* FOOTER A PANTALLA COMPLETA (DE ESQUINA A ESQUINA) */
.app-footer {
  width: 100%;
  background-color: var(--bg-dark);
  color: #FFFFFF;
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.team-members {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.member {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(0, 210, 255, 0.2);
}

/* CIRCULO DEL LOGO DE EQUIPO EN EL FOOTER (AMPLIADO A 65px) */
.footer-badge {
  width: 65px;
  height: 65px;
  min-width: 65px;
  min-height: 65px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 210, 255, 0.2);
}

.footer-avatar {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  border-radius: 50%;
  display: block;
}

/* REGLAS RESPONSIVAS PARA DISPOSITIVOS MÓVILES */
@media (max-width: 850px) {
  .login-wrapper {
    grid-template-columns: 1fr;
  }

  .main-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .product-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .product-image {
    width: 110px;
    height: 110px;
    min-width: 110px;
    min-height: 110px;
  }

  .product-info {
    width: 100%;
  }

  .card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .price {
    font-size: 1.3rem;
    text-align: center;
  }

  .action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .action-buttons .add-to-cart {
    grid-column: span 2;
    width: 100%;
  }

  .menu-header {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-admin-add {
    width: 100%;
  }

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

  .footer-right {
    justify-content: center;
  }
}