/* css/panel.css */

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Plus Jakarta Sans', sans-serif; 
}

body { 
    background: #f8fafc; /* Fondo base claro y limpio (Slate 50) */
    display: flex; 
    align-items: center; 
    justify-content: center; 
    height: 100vh; 
    overflow: hidden;
    position: relative;
}

/* --- DECORACIONES DE FONDO EN TONOS PASTELES --- */
.background-decor {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px); /* Desenfoque extra suave */
    opacity: 0.6;
}
.circle-1 {
    width: 350px;
    height: 350px;
    background: #ffdeeb; /* Rosa Pastel */
    top: 10%;
    left: 15%;
}
.circle-2 {
    width: 450px;
    height: 450px;
    background: #e0e7ff; /* Lavanda / Celeste Pastel */
    bottom: 5%;
    right: 12%;
}

/* --- CONTENEDOR EFECTO CRISTAL CLARO (LIGHT GLASSMORPHISM) --- */
.login-container { 
    background: rgba(255, 255, 255, 0.45); /* Blanco semi-transparente */
    backdrop-filter: blur(20px) saturate(160%); 
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.6); /* Borde blanco brillante sutil */
    padding: 40px; 
    border-radius: 28px; 
    box-shadow: 0 20px 40px rgba(148, 163, 184, 0.12); /* Sombra clara y orgánica */
    width: 90%; 
    max-width: 440px; 
    z-index: 2;
}

.header-icon {
    display: block;
    text-align: center;
    font-size: 42px;
    color: #a78bfa; /* Violeta pastel suave */
    margin-bottom: 12px;
}

h2 { 
    color: #334155; /* Gris pizarra elegante */
    margin-bottom: 6px; 
    text-align: center; 
    font-size: 26px;
    font-weight: 700;
}

p { 
    color: #64748b; 
    font-size: 16px; 
    text-align: center; 
    margin-bottom: 30px; 
}

.form-group { 
    margin-bottom: 24px; 
}

label { 
    display: block; 
    margin-bottom: 8px; 
    color: #475569; 
    font-weight: 600; 
    font-size: 15px; 
}

/* --- INPUTS ESTILO MINIMALISTA --- */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    font-size: 22px;
}

input { 
    width: 100%; 
    padding: 14px 14px 14px 48px; 
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2); 
    border-radius: 14px; 
    font-size: 16px; 
    color: #334155;
    transition: all 0.3s ease;
}

input::placeholder {
    color: #cbd5e1;
}

input:focus { 
    outline: none; 
    border-color: #a78bfa; /* Foco color lavanda */
    background: #ffffff;
    box-shadow: 0 0 15px rgba(167, 139, 250, 0.2);
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    width: 100%;
}

input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: none;
    border: none;
    width: 38px;
    height: 38px;
    cursor: pointer;
    padding: 0;
}

/* Forzar que el círculo se dibuje perfectamente en Chrome/Safari/Edge */
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(148, 163, 184, 0.3);
}

/* Forzar que se dibuje perfectamente en Firefox */
input[type="color"]::-moz-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(148, 163, 184, 0.3);
}

.color-preview-text { 
    font-size: 14px; 
    color: #475569; 
    font-weight: 600;
}

/* --- BOTÓN EN TONO PASTEL VIBRANTE --- */
button { 
    width: 100%; 
    padding: 16px; 
    background: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%); /* Degradado lila-celeste */
    color: white; 
    border: none; 
    border-radius: 14px; 
    font-size: 17px; 
    font-weight: 700; 
    cursor: pointer; 
    margin-top: 10px; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 16px rgba(167, 139, 250, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover {
    filter: brightness(1.05);
    box-shadow: 0 10px 20px rgba(167, 139, 250, 0.35);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(1px);
}

button:disabled { 
    background: #cbd5e1;
    background-image: none;
    color: #94a3b8;
    cursor: not-allowed; 
    transform: none;
    box-shadow: none;
}

.btn-icon {
    font-size: 18px;
}

/* --- ALERTAS SUAVES --- */
.alert-danger { 
    background: #fef2f2; 
    border: 1px solid #fca5a5; 
    color: #991b1b; 
    padding: 12px; 
    border-radius: 14px; 
    font-size: 15px; 
    margin-bottom: 20px; 
    text-align: center; 
}
/* --- DISEÑO ADICIONAL PARA EL DASHBOARD --- */
.dashboard-container {
    display: flex;
    width: 95vw;
    height: 90vh;
    max-width: 1400px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 32px;
    box-shadow: 0 24px 50px rgba(148, 163, 184, 0.15);
    z-index: 2;
    overflow: hidden;
}

/* BARRA LATERAL */
.sidebar {
    width: 280px;
    background: rgba(255, 255, 255, 0.3);
    border-right: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 10px;
}

.logo-icon {
    font-size: 32px;
    color: #a78bfa;
}
.movil-close {
    display: none; /* Ocultamos el botón de salir de la barra superior para ganar espacio */
}

.sidebar-header h2 {
    font-size: 20px;
    color: #334155;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.menu-item {
    display: none;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    border-radius: 16px;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #a78bfa;
}

.menu-item.active {
    background: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
    color: white;
    box-shadow: 0 8px 16px rgba(167, 139, 250, 0.2);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    box-shadow: none;
}
.btn-logout:hover {
    background: #fee2e2;
    color: #991b1b;
    box-shadow: none;
}

/* CONTENIDO CENTRAL */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 40px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding-bottom: 20px;
}

.content-header h1 {
    font-size: 28px;
    color: #334155;
    font-weight: 700;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    color: #475569;
    font-weight: 600;
}

.modulo-wrapper {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    padding: 30px;
}


/* =========================================================================
   COMPONENTE DE SUBIDA DE ARCHIVOS PREMIUM (GLASSMORPHISM PASTEL)
   ========================================================================= */
.upload-zone-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.custom-upload-label {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(255, 255, 255, 0.45);
    border: 2px dashed rgba(167, 139, 250, 0.35); /* Borde discontinuo lila pastel */
    border-radius: 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Efecto interactivo al pasar el mouse por encima */
.custom-upload-label:hover {
    background: rgba(255, 255, 255, 0.75);
    border-color: #a78bfa;
    box-shadow: 0 8px 20px rgba(167, 139, 250, 0.08);
    transform: translateY(-1px);
}

.upload-icon-cloud {
    font-size: 38px;
    color: #a78bfa; /* Icono lila pastel característico */
    margin-bottom: 8px;
    transition: transform 0.3s ease;
}

.custom-upload-label:hover .upload-icon-cloud {
    transform: translateY(-2px); /* El icono flota un poco al hacer hover */
}

.upload-label-title {
    font-size: 15px;
    color: #334155;
    font-weight: 600;
    margin-bottom: 4px;
}

.upload-label-subtitle {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

/* Efecto visual para el botón de borrar miniatura */
#btnQuitarLogo:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}
/* =========================================================================
   MÓDULO DE SUCURSALES - GRILLA Y TARJETAS PASTEL
   ========================================================================= */

/* Contenedor principal en cuadrícula responsiva */
.grid-sucursales {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
    width: 100%;
}

/* Tarjeta de Sucursal con Efecto Cristal */
.sucursal-card {
    background: rgba(255, 255, 255, 0.65); /* Fondo blanco traslúcido */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 20px rgba(148, 163, 184, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Animación sutil al pasar el mouse */
.sucursal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(148, 163, 184, 0.12);
}

/* Encabezado de la Tarjeta */
.sucursal-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Contenedor del Logo Redondeado */
.sucursal-logo-img {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    object-fit: cover;
    background: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

/* Título e Información de Ubicación */
.sucursal-card-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sucursal-card-title h3 {
    font-size: 18px;
    color: #334155;
    font-weight: 700;
    margin: 0;
}

.sucursal-card-title p {
    font-size: 14px;
    color: #64748b;
    text-align: left;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sucursal-card-title p span {
    font-size: 16px;
    color: #94a3b8;
}

/* Bloque de Redes Sociales (Botones Circulares Pasteles) */
.sucursal-card-socials {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
}

.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.social-icon span {
    font-size: 18px;
    color: white;
}

.social-icon:hover {
    filter: brightness(0.95);
    transform: scale(1.05);
}

/* Paleta Pastel Específica para Iconos de Redes */
.icon-wsp { background: #bbf7d0; } /* Verde menta pastel */
.icon-wsp span { color: #166534; }

.icon-ig { background: #fbcfe8; }  /* Rosa chicle pastel */
.icon-ig span { color: #9d174d; }

.icon-fb { background: #dbeafe; }  /* Azul cielo pastel */
.icon-fb span { color: #1e40af; }

/* Botón de Acción Inferior */
.sucursal-card-actions {
    width: 100%;
}

.btn-editar-sucursal {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-editar-sucursal span {
    font-size: 16px;
    color: #64748b;
}

.btn-editar-sucursal:hover {
    background: #ffffff;
    border-color: #a78bfa;
    color: #7c3aed;
    box-shadow: 0 4px 10px rgba(167, 139, 250, 0.1);
}
.btn-editar-sucursal:hover span {
    color: #7c3aed;
}

/* =========================================================================
   ESTILOS DE LA VENTANA MODAL (LIGHT GLASSMORPHISM)
   ========================================================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.15); /* Fondo oscuro muy tenue */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-content-wrapper {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 30px 60px rgba(148, 163, 184, 0.25);
    border-radius: 24px;
    width: 90%;
    max-width: 650px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    padding-bottom: 15px;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title-icon {
    color: #a78bfa;
    font-size: 26px;
}

.modal-header h3 {
    color: #334155;
    font-size: 20px;
    font-weight: 700;
}

.btn-close-modal {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.2s;
}
/* =========================================================================
   ADAPTACIÓN RESPONSIVA PARA LA VENTANA MODAL DE TIENDAS
   ========================================================================= */
@media (max-width: 768px) {
    /* Permitir que la modal tenga scroll interno si la pantalla del celular es muy baja */
    .modal-overlay {
        padding: 15px;
        align-items: flex-start; /* Alinea arriba para que no se corte el encabezado */
        overflow-y: auto;
    }

    .modal-content-wrapper {
        width: 100%;
        max-width: 100%;
        padding: 20px;
        margin-top: 20px; /* Margen de cortesía superior en móviles */
        gap: 15px;
    }

    /* FORZAR UNA SOLA COLUMNA: Rompemos las grillas de 2 y 3 columnas */
    .form-grid-2, 
    .form-grid-3 { 
        grid-template-columns: 1fr !important; 
        gap: 12px; 
    }

    /* Reducir márgenes de los grupos para ganar espacio vertical */
    .form-group {
        margin-bottom: 12px;
    }

    /* Ajustar el selector de color corporativo en celulares */
    .color-picker-wrapper {
        justify-content: flex-start;
        width: 100%;
    }

    /* Botonera inferior: Apilar botones o darles espacio cómodo para el pulgar */
    .modal-footer {
        flex-direction: column-reverse; /* El botón de cancelar queda abajo del de guardar */
        gap: 10px;
        padding-top: 15px;
    }

    .modal-footer button {
        width: 100% !important; /* Botones a lo ancho completo del celular */
        text-align: center;
        justify-content: center;
    }
}


.btn-close-modal:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Grillas dinámicas para acomodar inputs internos */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Selector de color corporativo */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }

.color-preview-text { font-size: 14px; color: #64748b; }

/* Botonera de la Modal */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    padding-top: 20px;
    margin-top: 10px;
}

.btn-secondary {
    background: rgba(241, 245, 217, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #475569;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
}
.btn-secondary:hover { background: #f1f5f9; }

.btn-primary {
    background: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    width: auto;
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.2);
    margin: 0;
}


/* =========================================================================
   ANIMACIONES DE TRANSICIÓN PARA EL LOGIN DE DOS PASOS
   ========================================================================= */

/* Contenedor base de los pasos */
.form-step {
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

/* Estado de salida: Se desvanece y se desplaza un poco a la izquierda */
.slide-out {
    opacity: 0;
    transform: translateX(-20px);
}

/* Estado de entrada previa: Oculto a la derecha listo para entrar */
.slide-in-prepare {
    opacity: 0;
    transform: translateX(20px);
}

/* Estado de entrada activa: Vuelve a su posición original visible */
.slide-in-active {
    opacity: 1;
    transform: translateX(0);
}


/* =========================================================================
   DASHBOARD RESPONSIVO Y CONFIGURACIÓN DE LOGO CORPORATIVO
   ========================================================================= */

/* Modificación del contenedor para que use el 100% en pantallas móviles */
.dashboard-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: none;
    border-radius: 0px; /* Bordes rectos para ocupar toda la pantalla eficientemente */
    box-shadow: none;
    z-index: 2;
    overflow: hidden;
}

/* Estilo para ajustar tu imagen transparente de forma fluida */
.brand-logo-img {
    width: 100%;
    max-width: 220px; /* Tamaño máximo sugerido para el menú lateral */
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #8a8b64; /* Gris slate suave, no invasivo */
    font-weight: 500;
    padding-left: 2px;
    letter-spacing: 0.2px;    
}
/* --- REGLAS DE MEDIOS (MEDIA QUERIES) PARA CELULARES Y TABLETS --- */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column; /* Apila el menú arriba y el contenido abajo */
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 15px 20px;
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    }

    .sidebar-header {
        margin-bottom: 15px;
        justify-content: center;
    }

    .brand-logo-img {
        max-width: 160px; /* Logo un poco más chico en celulares */
    }

    /* El menú se vuelve horizontal con scroll si no entran los botones */
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
        gap: 8px;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .menu-item {
        padding: 10px 14px;
        font-size: 14px;
    }

    .sidebar-footer {
        display: none; /* Ocultamos el botón de salir de la barra superior para ganar espacio */
    }
    .movil-close {
        display: flex; /* Ocultamos el botón de salir de la barra superior para ganar espacio */
    }

    /* El contenido central ocupa el resto de la pantalla de forma independiente */
    .main-content {
        padding: 20px;
        height: calc(100vh - 140px); /* Resta el espacio del menú superior */
        overflow-y: auto;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .content-header h1 {
        font-size: 22px;
    }

    .modulo-wrapper {
        padding: 15px;
        border-radius: 16px;
    }
}
