/* ============================================================
   CIRE • UNAH — Refero Design System Standard
   Archetype: Minimal High-Contrast Gallery & Technical Precision
   Guías: Human Interface Guidelines & styles.refero.design
   ============================================================ */

:root {
    /* 1. Superficies & Canvas (Refero Surface Progression) */
    --color-canvas: #f8f9fa;
    --color-canvas-alt: #f1f3f5;
    --color-canvas-dark: #090e17;
    --color-superficie: #ffffff;
    --color-superficie-elevada: #ffffff;
    --color-superficie-translucida: rgba(255, 255, 255, 0.86);

    /* 2. Jerarquía Tipográfica de Alto Contraste */
    --color-texto: #111827;
    --color-texto-secundario: #4b5563;
    --color-texto-terciario: #6b7280;
    --color-texto-muted: #9ca3af;
    --color-texto-invertido: #ffffff;

    /* 3. Acento Único Funcional (Single Functional Accent) */
    --color-primario: #0a2d59;           /* Azul Real UNAH */
    --color-secundario: #0071e3;         /* Precision Accent Blue */
    --color-secundario-hover: #0077ed;
    --color-secundario-active: #005bb5;
    --color-secundario-subtle: rgba(0, 113, 227, 0.06);
    --color-acento: #0071e3;
    --color-acento-glow: rgba(0, 113, 227, 0.14);

    /* 4. Semántica y Estados */
    --color-exito: #16a34a;
    --color-exito-bg: rgba(22, 163, 74, 0.08);
    --color-peligro: #dc2626;
    --color-peligro-bg: rgba(220, 38, 38, 0.08);
    --color-advertencia: #d97706;
    --color-advertencia-bg: rgba(217, 119, 6, 0.08);
    --color-info: #0071e3;
    --color-info-bg: rgba(0, 113, 227, 0.08);

    /* 5. Bordes Hairline de Alta Precisión */
    --borde-hairline: 1px solid rgba(0, 0, 0, 0.07);
    --borde-hairline-subtle: 1px solid rgba(0, 0, 0, 0.04);
    --borde-hairline-dark: 1px solid rgba(255, 255, 255, 0.10);
    --borde-focus: 0 0 0 3px var(--color-acento-glow);

    /* 6. Vocabulario Geométrico de Radios */
    --radio-micro: 6px;
    --radio-control: 8px;
    --radio: 10px;
    --radio-card: 14px;
    --radio-viewport: 16px;
    --radio-pill: 9999px;

    /* 7. Elevación y Sombras Hairline (Restringidas, sin difuminados pesados) */
    --sombra-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --sombra: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --sombra-md: 0 8px 24px -4px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
    --sombra-hover: 0 12px 32px -4px rgba(0, 0, 0, 0.08), 0 3px 8px -1px rgba(0, 0, 0, 0.03);
    --sombra-spotlight: 0 20px 48px -12px rgba(0, 0, 0, 0.10), 0 0 1px 1px rgba(0, 0, 0, 0.04);

    /* 8. Tipografías */
    --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

    /* 9. Transiciones */
    --transicion: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    --transicion-rapida: all 0.14s ease;
}

/* ============================================================
   RESET Y BASE TIPOGRÁFICA
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-ui);
    background-color: var(--color-canvas);
    color: var(--color-texto);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Enlaces base */
a {
    color: var(--color-secundario);
    text-decoration: none;
    transition: var(--transicion-rapida);
}
a:hover {
    color: var(--color-secundario-hover);
}

/* ============================================================
   NAVBAR (FROSTED GLASS CON PRECISIÓN HAIRLINE)
   ============================================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--color-superficie-translucida);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: var(--borde-hairline);
    padding: 0.65rem 2rem;
    transition: var(--transicion);
}

.navbar-container {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-texto);
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.logo:hover {
    opacity: 0.92;
}

.logo img {
    display: block;
}

.logo-unah-img {
    height: 44px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.06));
    transition: transform 0.2s ease;
}

.logo-cire-img {
    height: 38px;
    width: auto;
    border-radius: 0;
    transition: transform 0.2s ease;
}

.logo:hover .logo-unah-img,
.logo:hover .logo-cire-img {
    transform: scale(1.02);
}

.logo-separator {
    display: inline-block;
    width: 1px;
    height: 30px;
    background: rgba(0, 0, 0, 0.16);
    margin: 0 1px;
}

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

.nav-links a {
    color: var(--color-texto-secundario);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radio-pill);
    transition: var(--transicion-rapida);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-links a:hover {
    color: var(--color-texto);
    background: rgba(0, 0, 0, 0.04);
}

.nav-links a.active {
    color: var(--color-texto);
    background: rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

.user-pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-secundario-subtle);
    color: var(--color-secundario);
    padding: 0.35rem 0.8rem;
    border-radius: var(--radio-pill);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(0, 113, 227, 0.16);
}

.nav-admin-badge {
    background: #111827 !important;
    color: #ffffff !important;
    font-size: 0.8rem !important;
    padding: 0.35rem 0.85rem !important;
    border-radius: var(--radio-pill) !important;
    font-weight: 600 !important;
    transition: var(--transicion-rapida) !important;
}
.nav-admin-badge:hover {
    background: #000000 !important;
    transform: translateY(-1px);
}

/* ============================================================
   HERO EDITORIAL & CARRUSEL CON EFECTO CINEMATOGRÁFICO
   ============================================================ */
.hero-carrusel {
    position: relative;
    width: 100%;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    overflow: hidden;
    background: var(--color-canvas-dark);
}

.carrusel-backgrounds {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.carrusel-bg {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
}

.carrusel-bg.activo {
    opacity: 1;
    pointer-events: auto;
}

.carrusel-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.carrusel-overlay {
    position: absolute;
    inset: 0;
    /* Cero desenfoque para nitidez fotográfica total */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* Gradiente suave transparente: deja las imágenes nítidas, brillantes y claras */
    background: linear-gradient(
        180deg,
        rgba(3, 10, 24, 0.40) 0%,
        rgba(3, 10, 24, 0.08) 35%,
        rgba(3, 10, 24, 0.25) 65%,
        rgba(3, 10, 24, 0.84) 100%
    );
}

.hero-carrusel-content {
    position: relative;
    z-index: 2;
    max-width: 980px;
    padding: 5.5rem 2rem 4.5rem;
    margin: 0 auto;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(3, 10, 24, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.35rem 1rem;
    border-radius: var(--radio-pill);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hero-carrusel-content h2,
.hero h2 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 650;
    letter-spacing: -0.032em;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    color: #ffffff;
    text-shadow: 0 3px 20px rgba(0, 0, 0, 0.95), 0 1px 4px rgba(0, 0, 0, 0.9);
}

.hero-carrusel-content p,
.hero p {
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px;
    margin: 0 auto 2.5rem;
    font-weight: 400;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.95);
}

.hero-carrusel-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3.5rem;
}

/* Fallback hero sin carrusel */
.hero {
    background: linear-gradient(180deg, #0a2d59 0%, #06152a 100%);
    color: #ffffff;
    padding: 6rem 2rem 5rem;
    text-align: center;
}

/* Estadísticas con Contenedor Vidriado para máxima legibilidad sin tapar la imagen */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    background: rgba(3, 10, 24, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radio-lg);
    padding: 1.25rem 2.25rem;
    max-width: 820px;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-item .number {
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-ui);
    line-height: 1.1;
}

.stat-item .label {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.68);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
    margin-top: 0.35rem;
}

/* Controles sutiles del carrusel */
.carrusel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.20);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radio-pill);
    z-index: 5;
    transition: var(--transicion-rapida);
}
.carrusel-btn:hover {
    background: rgba(255, 255, 255, 0.26);
    transform: translateY(-50%) scale(1.05);
}
.carrusel-prev { left: 1.5rem; }
.carrusel-next { right: 1.5rem; }

.carrusel-dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}
.carrusel-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radio-pill);
    background: rgba(255, 255, 255, 0.32);
    cursor: pointer;
    transition: var(--transicion-rapida);
}
.carrusel-dot.activo, .carrusel-dot:hover {
    background: #ffffff;
    width: 20px;
}

/* ============================================================
   CONTENEDORES & TIPOGRAFÍA DE SECCIÓN
   ============================================================ */
.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.container-narrow {
    max-width: 860px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.section-header {
    margin-bottom: 2rem;
}

.section-eyebrow {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-secundario);
    display: block;
    margin-bottom: 0.35rem;
}

.section-title {
    font-size: clamp(1.6rem, 2.8vw, 2.25rem);
    font-weight: 650;
    letter-spacing: -0.026em;
    color: var(--color-texto);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--color-texto-secundario);
    max-width: 620px;
    line-height: 1.55;
}

/* ============================================================
   BOTONES & ACCIONES (REGLA DE ACCIÓN PRIMARIA ÚNICA)
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radio-control);
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transicion);
    border: 1px solid transparent;
    outline: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-pill {
    border-radius: var(--radio-pill);
}

/* Única acción primaria cromática */
.btn-primary {
    background: var(--color-secundario);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 113, 227, 0.2);
}
.btn-primary:hover {
    background: var(--color-secundario-hover);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.32);
}

/* Acciones secundarias neutrales (Ghost / Hairline) */
.btn-secondary {
    background: var(--color-canvas-alt);
    color: var(--color-texto);
    border: var(--borde-hairline);
}
.btn-secondary:hover {
    background: #e5e7eb;
    color: var(--color-texto);
    border-color: rgba(0, 0, 0, 0.12);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.14);
    color: var(--color-texto);
}
.btn-outline:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.28);
}

.btn-outline-light {
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #ffffff;
}
.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.20);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.40);
}

.btn-success { background: var(--color-exito); color: #fff; }
.btn-danger { background: var(--color-peligro); color: #fff; }
.btn-warning { background: var(--color-advertencia); color: #fff; }

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    border-radius: var(--radio-micro);
}

.btn-lg {
    padding: 0.8rem 1.85rem;
    font-size: 1rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ============================================================
   BUSCADOR SPOTLIGHT & CONTROLES
   ============================================================ */
.search-box {
    background: var(--color-superficie);
    padding: 1.15rem 1.35rem;
    border-radius: var(--radio-card);
    box-shadow: var(--sombra);
    border: var(--borde-hairline);
    margin-bottom: 2.5rem;
}

.search-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input-group {
    flex: 1;
    min-width: 260px;
    position: relative;
}

.search-form input[type="text"],
.search-input-group input {
    width: 100%;
    padding: 0.7rem 1.1rem;
    background: var(--color-canvas-alt);
    border: 1px solid transparent;
    border-radius: var(--radio-pill);
    font-size: 0.92rem;
    color: var(--color-texto);
    transition: var(--transicion-rapida);
    font-family: inherit;
}

.search-form input[type="text"]:focus,
.search-input-group input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--color-secundario);
    box-shadow: var(--borde-focus);
}

.search-form select {
    padding: 0.7rem 1.1rem;
    background: var(--color-canvas-alt);
    border: 1px solid transparent;
    border-radius: var(--radio-pill);
    font-size: 0.88rem;
    color: var(--color-texto);
    cursor: pointer;
    font-family: inherit;
    transition: var(--transicion-rapida);
}
.search-form select:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--color-secundario);
    box-shadow: var(--borde-focus);
}

/* Selector Segmentado */
.segmented-control {
    display: inline-flex;
    background: var(--color-canvas-alt);
    padding: 3px;
    border-radius: var(--radio-pill);
    gap: 2px;
    margin-bottom: 1.5rem;
    border: var(--borde-hairline);
}

.segmented-control a,
.segmented-control button {
    padding: 0.4rem 1rem;
    border-radius: var(--radio-pill);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-texto-secundario);
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: var(--transicion-rapida);
}

.segmented-control a.activo,
.segmented-control a.active,
.segmented-control button.active {
    background: #ffffff;
    color: var(--color-texto);
    box-shadow: var(--sombra-sm);
    font-weight: 600;
}

/* ============================================================
   GRID DE RECURSOS (MINIMAL HIGH-CONTRAST GALLERY)
   ============================================================ */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
}

.resource-card {
    background: var(--color-superficie);
    border-radius: var(--radio-card);
    overflow: hidden;
    box-shadow: var(--sombra);
    border: var(--borde-hairline);
    transition: var(--transicion);
    display: flex;
    flex-direction: column;
    position: relative;
}

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sombra-hover);
    border-color: rgba(0, 0, 0, 0.12);
}

/* Escenario 3D Inmersivo Oscuro */
.resource-preview {
    height: 220px;
    background: radial-gradient(circle at 50% 35%, #152238 0%, #070e1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.resource-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.resource-card:hover .resource-preview img {
    transform: scale(1.03);
}

/* Insignia de Formato (Frosted Glass Micro-Pill) */
.resource-type-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--color-texto);
    padding: 0.28rem 0.75rem;
    border-radius: var(--radio-pill);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Insignia Oficial UNAH en la Esquina Inferior Derecha */
.resource-unah-badge {
    position: absolute;
    bottom: 10px;
    right: 12px;
    z-index: 6;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    padding: 2px 7px 2px 5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, box-shadow 0.2s ease;
}

.resource-card:hover .resource-unah-badge {
    transform: translateY(-2px);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.resource-unah-badge img {
    height: 19px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block;
}

.resource-unah-badge span {
    font-size: 0.68rem;
    font-weight: 800;
    color: #0b2b5c;
    letter-spacing: 0.5px;
    line-height: 1;
}

.resource-body {
    padding: 1.35rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.resource-category {
    display: inline-block;
    color: var(--color-secundario);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
    font-family: var(--font-mono);
}

.resource-title {
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--color-texto);
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.resource-description {
    color: var(--color-texto-secundario);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex: 1;
}

.resource-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.9rem;
    border-top: var(--borde-hairline);
    margin-top: auto;
}

.resource-stats {
    font-size: 0.8rem;
    color: var(--color-texto-terciario);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
}

/* ============================================================
   VISOR INMERSIVO (3D / WEBXR / 360)
   ============================================================ */
.viewer-container {
    background: var(--color-superficie);
    border-radius: var(--radio-card);
    box-shadow: var(--sombra-md);
    border: var(--borde-hairline);
    overflow: hidden;
}

.viewer-header {
    padding: 1.5rem 2rem;
    border-bottom: var(--borde-hairline);
    background: var(--color-superficie);
}

.viewer-header h1 {
    font-size: 1.65rem;
    font-weight: 650;
    letter-spacing: -0.025em;
    color: var(--color-texto);
    margin-bottom: 0.35rem;
}

.viewer-content {
    padding: 2rem;
}

.model-viewer-wrapper,
.video-360-wrapper {
    position: relative;
    width: 100%;
    height: 560px;
    background: radial-gradient(circle at 50% 40%, #152238 0%, #060d18 100%);
    border-radius: var(--radio-viewport);
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4);
    border: var(--borde-hairline);
}

.model-viewer-wrapper model-viewer,
.video-360-wrapper video,
.video-360-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    outline: none;
}

.webxr-wrapper {
    position: relative;
    width: 100%;
    height: 650px;
    border-radius: var(--radio-viewport);
    overflow: hidden;
    border: var(--borde-hairline);
    background: #000000;
    box-shadow: var(--sombra);
}

.webxr-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.btn-fullscreen {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radio-pill);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    z-index: 15;
    transition: var(--transicion-rapida);
}
.btn-fullscreen:hover {
    background: rgba(0, 0, 0, 0.88);
    border-color: rgba(255, 255, 255, 0.45);
    transform: scale(1.02);
}

.youtube-360-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    z-index: 10;
}
.youtube-360-fallback-content {
    text-align: center;
    padding: 2rem;
    max-width: 480px;
}

.viewer-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--color-canvas-alt);
    border-radius: var(--radio-control);
    border: var(--borde-hairline);
}

.viewer-info h3 {
    font-size: 1.1rem;
    font-weight: 650;
    color: var(--color-texto);
    margin-bottom: 0.75rem;
}

/* ============================================================
   FORMULARIOS & CONTROLES
   ============================================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--color-texto);
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.form-control {
    width: 100%;
    padding: 0.7rem 0.95rem;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--radio-control);
    font-size: 0.92rem;
    color: var(--color-texto);
    transition: var(--transicion-rapida);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-secundario);
    box-shadow: var(--borde-focus);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.form-section {
    background: var(--color-superficie);
    padding: 2rem;
    border-radius: var(--radio-card);
    box-shadow: var(--sombra);
    border: var(--borde-hairline);
    margin-bottom: 2rem;
}

.form-section-title {
    font-size: 1.15rem;
    font-weight: 650;
    letter-spacing: -0.018em;
    color: var(--color-texto);
    margin-bottom: 1.25rem;
    padding-bottom: 0.65rem;
    border-bottom: var(--borde-hairline);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.15rem;
}

.file-upload {
    border: 1.5px dashed rgba(0, 113, 227, 0.35);
    border-radius: var(--radio-control);
    padding: 2.25rem 1.5rem;
    text-align: center;
    background: rgba(0, 113, 227, 0.015);
    cursor: pointer;
    transition: var(--transicion);
}

.file-upload:hover,
.file-upload.dragover {
    border-color: var(--color-secundario);
    background: rgba(0, 113, 227, 0.05);
}

.file-upload-label strong {
    color: var(--color-secundario);
    font-weight: 600;
}

/* ============================================================
   ALERTAS & CALLOUTS (ESTILO REFERO)
   ============================================================ */
.apple-callout,
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.85rem 1.15rem;
    border-radius: var(--radio-control);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.callout-success, .alert-success {
    background: var(--color-exito-bg);
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.2);
}

.callout-error, .callout-danger, .alert-danger {
    background: var(--color-peligro-bg);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.2);
}

.callout-warning, .alert-warning {
    background: var(--color-advertencia-bg);
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.2);
}

.callout-info, .alert-info {
    background: var(--color-info-bg);
    color: #0369a1;
    border-color: rgba(0, 113, 227, 0.18);
}

/* ============================================================
   PÁGINAS DE LOGIN & REGISTRO
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% -20%, #e5e7eb 0%, #f8f9fa 60%, #f1f3f5 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-backdrop-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.login-box {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: 2.5rem 2.25rem;
    border-radius: var(--radio-card);
    box-shadow: var(--sombra-spotlight);
    border: var(--borde-hairline);
    width: 100%;
    max-width: 430px;
    position: relative;
    z-index: 2;
}

.login-logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.75rem;
    text-decoration: none;
}

.login-header-text .eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-texto-terciario);
    display: block;
    margin-bottom: 0.2rem;
}

.login-header-text h2 {
    font-size: 1.45rem;
    font-weight: 650;
    letter-spacing: -0.026em;
    color: var(--color-texto);
    margin: 0;
}

.login-header-text p {
    font-size: 0.85rem;
    color: var(--color-texto-secundario);
    margin-top: 0.2rem;
}

.login-footer {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: var(--borde-hairline);
    text-align: center;
    font-size: 0.86rem;
    color: var(--color-texto-secundario);
}

.login-secondary-links {
    margin-top: 0.85rem;
    display: flex;
    justify-content: center;
}

.link-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--color-texto-terciario);
    font-size: 0.84rem;
}
.link-back:hover {
    color: var(--color-texto);
}

/* ============================================================
   PANEL DE ADMINISTRACIÓN (PRECISIÓN DEV TOOL REFERO)
   ============================================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--color-canvas);
}

.admin-sidebar {
    width: 260px;
    background: #0d1117;
    color: #ffffff;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 100;
    user-select: none;
}

.admin-sidebar-header {
    padding: 1.25rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo-frame {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-logo-img {
    height: 20px;
    width: auto;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 650;
    letter-spacing: -0.015em;
    color: #ffffff;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Navegación Agrupada */
.admin-nav-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0 0.65rem 0.4rem 0.65rem;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s ease;
    text-decoration: none;
    position: relative;
}

.nav-item-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.nav-item-icon svg {
    width: 18px;
    height: 18px;
}

.nav-item-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}

.nav-item:hover .nav-item-icon {
    color: #cbd5e1;
}

.nav-item.active {
    background: #0071e3;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 113, 227, 0.35);
}

.nav-item.active .nav-item-icon {
    color: #ffffff;
}

.nav-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 980px;
    line-height: 1.3;
}

.nav-badge-warning { background: #d97706; color: #fff; }
.nav-badge-danger { background: #ef4444; color: #fff; }
.nav-badge-info { background: #0071e3; color: #fff; }

/* Footer del Sidebar */
.admin-sidebar-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.user-avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 980px;
    background: rgba(0, 113, 227, 0.2);
    border: 1px solid rgba(0, 113, 227, 0.4);
    color: #38bdf8;
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.user-info-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-subtext {
    font-size: 0.7rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-sidebar-logout {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.15s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.btn-sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.btn-sidebar-logout svg {
    width: 16px;
    height: 16px;
}

/* ÁREA PRINCIPAL */
.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 2.25rem 2.75rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.15rem;
    border-bottom: var(--borde-hairline);
}

.admin-header h1 {
    font-size: 1.75rem;
    font-weight: 650;
    letter-spacing: -0.026em;
    color: var(--color-texto);
    margin: 0;
}

/* Tarjetas de Métricas Dashboard (Estilo Linear / Precision) */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.25rem;
}

.dashboard-card {
    background: #ffffff;
    padding: 1.35rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.07);
    display: flex;
    align-items: center;
    gap: 1.15rem;
    transition: all 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
}

.dashboard-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-card-icon svg {
    width: 22px;
    height: 22px;
}

.dashboard-card-icon.blue { 
    background: rgba(0, 113, 227, 0.08); 
    color: #0071e3; 
    border: 1px solid rgba(0, 113, 227, 0.18); 
}
.dashboard-card-icon.orange { 
    background: rgba(217, 119, 6, 0.08); 
    color: #d97706; 
    border: 1px solid rgba(217, 119, 6, 0.18); 
}
.dashboard-card-icon.green { 
    background: rgba(22, 163, 74, 0.08); 
    color: #16a34a; 
    border: 1px solid rgba(22, 163, 74, 0.18); 
}
.dashboard-card-icon.red { 
    background: rgba(37, 99, 235, 0.08); 
    color: #2563eb; 
    border: 1px solid rgba(37, 99, 235, 0.18); 
}

.dashboard-card-info h3 {
    font-size: 1.85rem;
    font-weight: 650;
    letter-spacing: -0.03em;
    color: var(--color-texto);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    line-height: 1.1;
    margin: 0;
}

.dashboard-card-info p {
    font-size: 0.8rem;
    color: var(--color-texto-secundario);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Indicadores de Estado con Punto Luminoso (Status Pills) */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 980px;
    font-size: 0.76rem;
    font-weight: 550;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 980px;
    flex-shrink: 0;
}

.status-approved, .status-completado, .status-activo {
    background: rgba(22, 163, 74, 0.09);
    color: #15803d;
    border: 1px solid rgba(22, 163, 74, 0.25);
}
.status-approved .status-dot, .status-completado .status-dot, .status-activo .status-dot {
    background: #16a34a;
    box-shadow: 0 0 6px rgba(22, 163, 74, 0.5);
}

.status-pending, .status-pendiente {
    background: rgba(217, 119, 6, 0.09);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.25);
}
.status-pending .status-dot, .status-pendiente .status-dot {
    background: #d97706;
    box-shadow: 0 0 6px rgba(217, 119, 6, 0.5);
}

.status-rejected, .status-cancelado, .status-inactivo {
    background: rgba(220, 38, 38, 0.09);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.25);
}
.status-rejected .status-dot, .status-cancelado .status-dot, .status-inactivo .status-dot {
    background: #dc2626;
}

.status-dev, .status-en-desarrollo {
    background: rgba(0, 113, 227, 0.09);
    color: #0071e3;
    border: 1px solid rgba(0, 113, 227, 0.25);
}
.status-dev .status-dot, .status-en-desarrollo .status-dot {
    background: #0071e3;
    box-shadow: 0 0 6px rgba(0, 113, 227, 0.5);
}

.status-neutral {
    background: rgba(107, 114, 128, 0.09);
    color: #4b5563;
    border: 1px solid rgba(107, 114, 128, 0.2);
}
.status-neutral .status-dot {
    background: #9ca3af;
}

.dashboard-card-info p {
    font-size: 0.82rem;
    color: var(--color-texto-secundario);
    margin-top: 0.2rem;
}

/* Tablas con Monospace en Identificadores */
.table-container {
    background: var(--color-superficie);
    border-radius: var(--radio-card);
    box-shadow: var(--sombra);
    border: var(--borde-hairline);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: var(--color-canvas-alt);
    border-bottom: var(--borde-hairline);
}

.data-table th {
    padding: 0.85rem 1.15rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-texto-secundario);
}

.data-table td {
    padding: 1rem 1.15rem;
    border-bottom: var(--borde-hairline);
    color: var(--color-texto);
}

.data-table td strong {
    font-family: var(--font-mono);
    font-weight: 600;
}

.data-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.015);
}

/* Badges de Estado */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radio-pill);
    font-size: 0.74rem;
    font-weight: 600;
}

.badge-success { background: var(--color-exito-bg); color: #15803d; border: 1px solid rgba(22, 163, 74, 0.2); }
.badge-warning { background: var(--color-advertencia-bg); color: #b45309; border: 1px solid rgba(217, 119, 6, 0.2); }
.badge-danger { background: var(--color-peligro-bg); color: #b91c1c; border: 1px solid rgba(220, 38, 38, 0.2); }
.badge-info { background: var(--color-info-bg); color: #0284c7; border: 1px solid rgba(2, 132, 199, 0.2); }
.badge-secondary { background: rgba(107, 114, 128, 0.08); color: #4b5563; border: 1px solid rgba(107, 114, 128, 0.16); }

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 2.25rem;
}

.pagination a, .pagination span {
    padding: 0.45rem 0.85rem;
    border-radius: var(--radio-pill);
    font-size: 0.84rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transicion-rapida);
}

.pagination a {
    background: var(--color-superficie);
    color: var(--color-texto);
    border: var(--borde-hairline);
}
.pagination a:hover {
    background: var(--color-canvas-alt);
    border-color: rgba(0, 0, 0, 0.16);
}
.pagination .current {
    background: var(--color-texto);
    color: #ffffff;
}

/* Footer Oficial */
.footer {
    background: var(--color-canvas-alt);
    color: var(--color-texto-secundario);
    padding: 3rem 2rem;
    text-align: center;
    border-top: var(--borde-hairline);
    margin-top: 5rem;
    font-size: 0.86rem;
}

/* Responsive */
@media (max-width: 900px) {
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; position: relative; }
    .admin-main { margin-left: 0; padding: 2rem 1.5rem; }
}

@media (max-width: 768px) {
    .navbar-container { flex-direction: column; gap: 0.75rem; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .hero-stats { gap: 1.75rem; }
    .resources-grid { grid-template-columns: 1fr; }
    .carrusel-btn { display: none; }
    .search-form { flex-direction: column; }
    .search-form input, .search-form select, .search-form button { width: 100%; }
}
