/* ==========================================================================
   CONFIGURACIÓN Y VARIABLES
   ========================================================================== */
:root {
    --gold: #D4AF37;
    --gold-dim: #967d28;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --bg-dark: #050505;
    --glass-bg: rgba(30, 30, 30, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(212, 175, 55, 0.3);
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --font-head: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
}

body {
    margin: 0; padding: 0;
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 0%, #222 0%, #000 70%);
    background-attachment: fixed;
    color: var(--text-main);
    padding-bottom: 90px;
    min-height: 100vh;
}

/* --- TIPOGRAFÍA --- */
h2, h3, h1 { font-family: var(--font-head); font-weight: 500; color: var(--gold); margin: 0; }
h2 { font-size: 1.8rem; margin-bottom: 5px; }
small { font-size: 0.8rem; color: var(--text-muted); }

/* ==========================================================================
   COMPONENTES CORE (GLASSMORPHISM & UI)
   ========================================================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-highlight);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 15px;
    transition: transform 0.2s;
}

.input-glass, select.input-glass {
    width: 100%; padding: 15px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white; font-family: var(--font-body); font-size: 1rem;
    margin-bottom: 15px; transition: 0.3s;
}
.input-glass:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 10px var(--glass-glow); }

.btn-gold-gradient {
    width: 100%; padding: 15px;
    background: linear-gradient(135deg, #E5C558 0%, #D4AF37 100%);
    border: none; border-radius: 12px;
    color: #000; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    cursor: pointer; box-shadow: 0 5px 15px var(--gold-glow);
}
.btn-gold-gradient:active { transform: scale(0.98); }

/* ==========================================================================
   LOGIN & ACCESO
   ========================================================================== */
.login-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
}
.login-box { width: 85%; max-width: 380px; text-align: center; padding: 40px 30px; animation: floatUp 0.6s ease-out; }

.login-logo-img {
    width: 120px; height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.5));
}

.login-subtitle { margin-bottom: 30px; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; font-size: 0.8rem; }
.login-avatars-container { display: flex; justify-content: center; gap: 15px; margin: 20px 0; flex-wrap: wrap; }
.avatar-login { width: 60px; height: 60px; border-radius: 50%; border: 2px solid transparent; opacity: 0.5; cursor: pointer; transition: 0.3s; object-fit: cover; }
.avatar-login.selected, .avatar-login:hover { opacity: 1; border-color: var(--gold); transform: scale(1.1); box-shadow: 0 0 15px var(--gold-glow); }

/* ==========================================================================
   HEADER & NAVEGACIÓN
   ========================================================================== */
.glass-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(5, 5, 5, 0.85); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 10px 20px;
}
.header-content { display: flex; justify-content: space-between; align-items: center; max-width: 600px; margin: 0 auto; }
.logo-mini { font-family: var(--font-head); color: var(--gold); font-weight: 700; letter-spacing: 1px; }
.user-status { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-info-text { text-align: right; }
.user-info-text span { display: block; font-weight: 600; font-size: 0.9rem; }
.user-info-text small { color: var(--gold); }
#header-user-img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; }

.glass-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(0,0,0,0.9); backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-around; padding: 15px 0 25px; z-index: 99;
}
.nav-btn { background: none; border: none; color: #555; font-size: 0.7rem; display:flex; flex-direction: column; align-items: center; cursor: pointer; transition: 0.2s; }
.nav-btn i { font-size: 1.3rem; margin-bottom: 4px; }
.nav-btn.active, .nav-btn:active { color: var(--gold); transform: translateY(-3px); text-shadow: 0 0 10px var(--gold-glow); background: rgba(212, 175, 55, 0.1); border-radius: 8px; }

/* ==========================================================================
   LAYOUT SECTIONS & KPI
   ========================================================================== */
main { padding: 20px; max-width: 600px; margin: 0 auto; }
section { display: none; animation: fadeIn 0.4s ease; }
.active-section { display: block; }
.section-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
.kpi-card { display: flex; align-items: center; gap: 15px; cursor: pointer; padding: 15px; }
.kpi-card:active { transform: scale(0.98); background: rgba(212, 175, 55, 0.1); }
.icon-circle { width: 40px; height: 40px; background: rgba(212, 175, 55, 0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--gold); }
.kpi-data h3 { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-body); letter-spacing: 1px; }
.kpi-data span { font-size: 1.4rem; font-weight: 700; color: white; }

/* ==========================================================================
   LISTAS Y BÚSQUEDA
   ========================================================================== */
.search-glass-container {
    position: relative; margin-bottom: 20px; background: rgba(255, 255, 255, 0.05);
    border-radius: 50px; padding: 5px 20px; border: 1px solid rgba(212, 175, 55, 0.2);
    display: flex; align-items: center; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.search-logo-icon { width: 25px; height: 25px; object-fit: contain; margin-right: 10px; filter: drop-shadow(0 0 2px rgba(212, 175, 55, 0.5)); }
.search-input { background: transparent; border: none; color: white; width: 100%; padding: 10px 0; font-size: 1rem; }
.search-input:focus { outline: none; }

.list-item-glass {
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(90deg, rgba(30,30,30,0.6) 0%, rgba(20,20,20,0.8) 100%);
    backdrop-filter: blur(10px); border-radius: 16px; padding: 15px; margin-bottom: 12px; 
    border: 1px solid rgba(255,255,255,0.05);
}
.item-left { display: flex; align-items: center; gap: 15px; }
.client-avatar { width: 45px; height: 45px; background: rgba(212, 175, 55, 0.1); color: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; border: 1px solid var(--gold-dim); }
.item-info h4 { margin: 0; color: white; font-weight: 600; font-size: 1rem; }

/* ==========================================================================
   MÓDULO DE CAJA (POS)
   ========================================================================== */
.cliente-selector { display: flex; align-items: center; justify-content: space-between; cursor: pointer; border-left: 4px solid var(--gold); }
.selector-icon { font-size: 1.5rem; color: var(--text-muted); }
.selector-info h3 { font-family: var(--font-body); color: white; margin-top: 5px; font-weight: 600; }
.menu-servicios-title { margin: 20px 0 10px; text-transform: uppercase; font-size: 0.8rem; color: var(--gold); letter-spacing: 2px; }
.servicios-grid { display: grid; gap: 10px; }
.servicio-btn {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px; cursor: pointer; transition: 0.2s;
}
.servicio-btn.selected { background: rgba(212, 175, 55, 0.15); border-color: var(--gold); }
.servicio-btn span { color: var(--gold); font-weight: bold; }

.total-float {
    position: fixed; bottom: 85px; left: 20px; right: 20px; max-width: 560px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center; z-index: 90;
    background: rgba(10,10,10,0.95); border: 1px solid var(--gold); padding: 15px; border-radius: 20px;
}
.total-details span { display: block; font-size: 1.4rem; color: var(--gold); font-weight: bold; }
.btn-checkout { background: var(--gold); color: black; border: none; padding: 10px 20px; border-radius: 30px; font-weight: bold; cursor: pointer; display: flex; gap: 5px; align-items: center; }

/* ==========================================================================
   MODALES Y UTILIDADES
   ========================================================================== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); z-index: 3000; align-items: center; justify-content: center; }
.modal-box { width: 90%; max-width: 400px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }
.modal-header span { font-size: 2rem; cursor: pointer; color: var(--text-muted); }

.alerta-item { background: rgba(212, 175, 55, 0.1); border-left: 3px solid var(--gold); padding: 12px; border-radius: 8px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; }
.hidden { display: none !important; }

/* ==========================================================================
   INTERACCIONES Y FIXES DE BOTONES (CRÍTICO)
   ========================================================================== */
.btn-circle-gold { 
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gold); 
    background: transparent; color: var(--gold); font-size: 1.2rem; cursor: pointer; 
    display: flex; align-items: center; justify-content: center; transition: 0.2s;
}

.btn-circle-gold:hover { background: var(--gold-glow); transform: scale(1.1); }

.action-btn-group { display: flex; gap: 8px; }
.btn-icon-action { width: 35px; height: 35px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }

/* IMPORTANTE: Evita que el icono interfiera con el click del botón */
.btn-circle-gold i, .btn-icon-action i {
    pointer-events: none;
}

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */
@keyframes floatUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* TABLE */
.premium-table { width: 100%; border-collapse: collapse; }
.premium-table th { text-align: left; color: var(--gold); border-bottom: 1px solid rgba(255,255,255,0.1); padding: 10px; }
.premium-table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.05); }
}