/**
 * @file main.css
 * @description Estilos globales base y arquitectura Light Theme 3D para CONECTA POS.
 * Paleta corporativa:
 * - Azul Oscuro: #060B26 (Tipografía de alto impacto e íconos clave)
 * - Naranja Brillante: #FF7A0D (Llamados a la acción CTA y foco activo)
 * - Naranja Oscuro: #C14E00 (Estados hover y micro-relieves)
 * - Fondos Luminosos: #FFFFFF y #F8FAFC (Amplitud y cero fatiga visual)
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Outfit:wght@600;700;800;900&display=swap');

:root {
    /* --- PALETA CORPORATIVA ESTRICTA --- */
    --navy-dark: #060B26;
    --brand-navy: #060B26;
    --navy-surface: #F8FAFC;
    --navy-light: #E2E8F0;
    
    --orange-primary: #FF7A0D;
    --brand-orange: #FF7A0D;
    --orange-hover: #C14E00;
    --brand-orange-dark: #C14E00;
    --orange-soft: #FFF7ED;
    --brand-orange-subtle: #FFF7ED;
    --orange-border: rgba(255, 122, 13, 0.35);

    /* --- ESTADOS SEMÁFORO --- */
    --green-accent: #059669;
    --green-soft: #ECFDF5;
    --green-border: #6EE7B7;
    --blue-accent: #2563EB;
    --blue-soft: #EFF6FF;
    --red-alert: #DC2626;
    --red-soft: #FEF2F2;

    /* --- LIENZOS & SUPERFICIES CLARAS (LIGHT THEME PREDOMINANTE) --- */
    --gray-bg: #F8FAFC;
    --gray-card: #FFFFFF;
    --gray-border: #E2E8F0;
    --gray-alt: #F1F5F9;
    --text-main: #060B26;
    --text-muted: #64748B;
    --text-light: #94A3B8;

    /* --- RADIOS ARQUITECTÓNICOS --- */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    /* --- ELEVACIÓN & SOMBRAS 3D SUAVES MULTICAPA --- */
    --shadow-sm: 0 1px 3px rgba(6, 11, 38, 0.04), 0 4px 12px rgba(6, 11, 38, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(6, 11, 38, 0.04), 0 14px 28px -4px rgba(6, 11, 38, 0.07);
    --shadow-lg: 0 16px 36px -4px rgba(6, 11, 38, 0.10), 0 8px 16px -2px rgba(6, 11, 38, 0.04);
    
    --shadow-3d-sm: 
        0 1px 3px rgba(6, 11, 38, 0.04),
        0 6px 16px -2px rgba(6, 11, 38, 0.05),
        0 1px 0 rgba(255, 255, 255, 0.9) inset;

    --shadow-3d-md: 
        0 4px 6px -1px rgba(6, 11, 38, 0.04),
        0 14px 28px -4px rgba(6, 11, 38, 0.07),
        0 1px 0 rgba(255, 255, 255, 1) inset;

    --shadow-3d-hover: 
        0 16px 36px -4px rgba(6, 11, 38, 0.10),
        0 8px 16px -2px rgba(6, 11, 38, 0.04),
        0 1px 0 rgba(255, 255, 255, 1) inset;

    --shadow-3d-modal: 
        0 24px 60px -12px rgba(6, 11, 38, 0.18),
        0 12px 24px -6px rgba(6, 11, 38, 0.08);

    --shadow-btn-cta: 
        0 4px 14px rgba(255, 122, 13, 0.28),
        0 2px 4px rgba(193, 78, 0, 0.20),
        0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

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

body {
    background-color: var(--gray-bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    max-width: 100%;
}

/* =====================================================================
   1. NAVBAR SUPERIOR FIJO (LIGHT THEME CON VIDRIO Y SOMBRA SUAVE)
   ===================================================================== */
.navbar {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--navy-dark);
    padding: 10px 28px;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-border);
    box-shadow: 0 4px 20px rgba(6, 11, 38, 0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand-badge {
    background: linear-gradient(135deg, var(--orange-primary) 0%, var(--orange-hover) 100%);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(255, 122, 13, 0.3);
}

.brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--navy-dark);
    letter-spacing: -0.5px;
}

.brand-title span {
    color: var(--orange-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}

.nav-link, .nav-item {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

.nav-link:hover, .nav-item:hover {
    color: var(--navy-dark);
    background: var(--gray-bg);
    border-color: var(--gray-border);
    box-shadow: var(--shadow-3d-sm);
    transform: translateY(-1px);
}

.nav-link.active, .nav-item.active {
    color: var(--brand-orange-dark);
    background: var(--orange-soft);
    border-color: var(--orange-border);
    box-shadow: 0 2px 8px rgba(255, 122, 13, 0.12);
}

.nav-link.active i, .nav-item.active i {
    color: var(--orange-primary);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FFFFFF;
    padding: 6px 14px 6px 8px;
    border-radius: 30px;
    border: 1px solid var(--gray-border);
    box-shadow: var(--shadow-3d-sm);
}

.user-avatar {
    width: 30px;
    height: 30px;
    background: var(--navy-dark);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.78rem;
}

.user-meta .name {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--navy-dark);
    line-height: 1.2;
}

.user-meta .company {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--orange-primary);
}

.btn-logout {
    background: var(--gray-alt);
    border: 1px solid var(--gray-border);
    color: var(--navy-dark);
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.80rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: var(--shadow-3d-sm);
}

.btn-logout:hover {
    background: var(--red-soft);
    border-color: rgba(220, 38, 38, 0.3);
    color: var(--red-alert);
}

/* =====================================================================
   2. BREADCRUMBS ANTI-PÉRDIDA (RETROCESO EN 1 CLIC)
   ===================================================================== */
.breadcrumbs-bar, .tactile-breadcrumb-bar {
    background: #FFFFFF;
    border-bottom: 1px solid var(--gray-border);
    padding: 10px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.breadcrumb-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gray-alt);
    border: 1px solid var(--gray-border);
    color: var(--navy-dark);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-3d-sm);
}

.breadcrumb-back-btn:hover {
    background: #FFFFFF;
    border-color: var(--orange-primary);
    color: var(--orange-hover);
    transform: translateX(-2px);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    font-size: 0.88rem;
}

.breadcrumb-item a, .breadcrumb-crumb {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.breadcrumb-item a:hover, .breadcrumb-crumb:hover {
    color: var(--navy-dark);
}

.breadcrumb-item.current, .breadcrumb-current {
    color: var(--navy-dark);
    font-weight: 800;
}

.breadcrumb-separator {
    color: var(--text-light);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

/* =====================================================================
   3. BOTONES TÁCTILES CON RELIEVE 3D & RESPUESTA HÁPTICA
   ===================================================================== */
.btn-primary {
    background: linear-gradient(180deg, var(--orange-primary) 0%, #F57100 100%);
    color: #ffffff;
    border: 1px solid var(--orange-hover);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-btn-cta);
    text-decoration: none;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #FF8824 0%, var(--orange-hover) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 122, 13, 0.40), 0 3px 6px rgba(193, 78, 0, 0.25);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(255, 122, 13, 0.3);
}

.btn-secondary {
    background: #ffffff;
    color: var(--navy-dark);
    border: 1px solid var(--gray-border);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-3d-sm);
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--gray-bg);
    border-color: #CBD5E1;
    transform: translateY(-1px);
    box-shadow: var(--shadow-3d-md);
}

.btn-secondary:active {
    transform: translateY(1px);
}

/* =====================================================================
   4. MODALES FLOTANTES 3D CON BACKDROP BLUR
   ===================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 11, 38, 0.40);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #ffffff;
    border-radius: 20px;
    width: 95%;
    max-width: 520px;
    box-shadow: var(--shadow-3d-modal);
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
    transform: scale(0.95) translateY(12px);
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-header {
    background: #FFFFFF;
    color: var(--navy-dark);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-border);
}

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--navy-dark);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.modal-close:hover {
    color: var(--navy-dark);
    background: var(--gray-alt);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.80rem;
    font-weight: 800;
    color: var(--navy-dark);
}

.form-control {
    padding: 10px 14px;
    border: 1.5px solid var(--gray-border);
    border-radius: 10px;
    font-size: 0.90rem;
    color: var(--navy-dark);
    background: #FFFFFF;
    outline: none;
    transition: all 0.2s;
    box-shadow: var(--shadow-3d-sm);
}

.form-control:focus {
    border-color: var(--orange-primary);
    box-shadow: 0 0 0 3px rgba(255, 122, 13, 0.18);
}

.modal-footer {
    padding: 16px 24px;
    background: var(--gray-bg);
    border-top: 1px solid var(--gray-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* =====================================================================
   5. SKELETONS, GLASSMORPHISM & PWA STATUS
   ===================================================================== */
@keyframes shimmerWave {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-box {
    background: linear-gradient(90deg, #E2E8F0 25%, #F8FAFC 37%, #E2E8F0 63%);
    background-size: 400% 100%;
    animation: shimmerWave 1.4s ease infinite;
    border-radius: 8px;
}

.skeleton-card {
    height: 180px;
    border-radius: 14px;
    background: linear-gradient(90deg, #E2E8F0 25%, #FFFFFF 37%, #E2E8F0 63%);
    background-size: 400% 100%;
    animation: shimmerWave 1.4s ease infinite;
}

.pwa-offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #D97706, #B45309);
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.pwa-offline-banner.active {
    display: flex;
}
