/* 
   ESTILO: Unificado Glassmorphism Premium
   PALETA: Deep Emerald & Gold Lux
*/

:root {
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  --dark-green: #061a12;
  --emerald: #0a2e1f;
  --gold: #c8b273;
  --gold-light: #D5B979;
  --text-white: #110f0f;
  --text-gold: #e5c100;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top right, #c6e2c6, #233b23);
  background-attachment: fixed;
  color: var(--text-white);
  height: 100vh;
  overflow: hidden;
}

/* === Layout Principal === */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* === Barras de desplazamiento Estilo Glass === */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 10px;
}

/* === Panel Lateral (Clientes) === */
#panel-clientes {
  width: 320px;
  min-width: 300px;
  background: rgba(87, 95, 92, 0.11);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto; /* 👈 AGREGA ESTA LÍNEA */
}

#panel-clientes h2 {
  color: var(--gold);
  text-transform: uppercase;
  font-size: 1.5rem;
  letter-spacing: 1px;
  margin-bottom: 20px;
  text-align: center;
}

/* === Inputs y Buscadores === */
input, select, textarea {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: rgb(6, 32, 3);
  margin-bottom: 15px;
  outline: none;
  transition: all 0.3s ease;
}

input:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

/* === Lista de Clientes === */
.cliente-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 12px 15px;
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cliente-item:hover {
  background: rgba(212, 175, 55, 0.1);
  transform: translateX(5px);
  border-color: var(--gold);
}

.cliente-item.deudor {
  border-left: 4px solid var(--gold);
}

/* === Panel de Detalle (Contenido Principal) === */
#panel-detalle {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.1);
}

/* === Tarjetas Glassmorphism === */
.card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--glass-shadow);
}

.card h3 {
  color: var(--gold);
  margin-top: 0;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
}

/* === Compra Card Items === */
.compra-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 15px;
  transition: transform 0.2s;
}

.compra-card:hover {
  transform: scale(1.01);
}

/* === Botones === */
button {
  background: var(--gold);
  color: var(--dark-green);
  border: 1px solid var(--glass-border);
  padding: 3px 9px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

button:hover {
  background: var(--gold-light);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

.btn-secundario {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
}

.btn-secundario:hover {
  background: var(--gold);
  color: var(--dark-green);
}

/* === Detalles y estados === */
.detalle-productos {
  margin-top: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  border: 1px dashed var(--glass-border);
}

.vacio {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.hidden { display: none !important; }

/* === Responsive (Mobile) === */
@media (max-width: 768px) {
  #app {
    flex-direction: column;
  }

  #panel-clientes {
    
    width: 100%;
    max-width: 100%;
    height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    
  }

  #panel-detalle {
    height: 60vh;
    padding: 15px;
  }

  .card {
    border-radius: 15px;
    
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.hidden {
  display: none !important;
}

.modal-contenido {
  background: white;
  border-radius: 12px;
  padding: 16px;
  width: 95%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.linea-resumen-pago {
  padding: 6px 0;
  border-bottom: 1px dashed #e5e7eb;
  font-size: 14px;
}
.acciones-cliente {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 15px;
}

.btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.primary {
  background: #d6b76c;
}

.secondary {
  background: #7fb87a;
}

.whatsapp {
  background: #25d366;
  color: white;
}

.dropdown {
  position: static;
}

.dropdown-menu {
  position: absolute;
  top: 30px;
  right: 110px;
  background: transparent;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  display: none;
  min-width: 220px;
  overflow: hidden;
  z-index: 20;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu .item {
  padding: 10px 14px;
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
}

.dropdown-menu .item:hover {
  background:var(--glass-border);
}

.item.danger {
  color: #b91c1c;
  font-weight: 700;
}
.menu-cliente {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.menu-cliente button {
  padding: 8px;
  border-radius: 8px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  background: #e5d18c;
}

.menu-cliente .danger {
  background: #dc2626;
  color: white;
}
.fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--glass-shadow);
  text-decoration: none;
  color: white;
}


