/* ============================================================
   PREMIUM - Capa de refinamiento visual plataforma Innovar
   Se carga despues de style.css. Solo mejora; no rompe clases
   existentes. Efecto: diseno de producto profesional.
   ============================================================ */

/* --- Tipografia Poppins (identidad Servitecening) --- */
html { overflow-x: hidden; overflow-x: clip; }
body {
    font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background: linear-gradient(180deg, #F6F8FC 0%, #F1F4FA 100%);
}
h1, h2, h3, h4, h5, h6 { font-family: 'Poppins', 'Segoe UI', sans-serif; letter-spacing: -0.2px; }
input, select, textarea, button { font-family: inherit; }

::selection { background: rgba(240,176,48,0.28); color: #100040; }

/* --- Scrollbar refinada --- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #EEF1F6; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #C4CBDA, #9AA4BC); border-radius: 8px; border: 2px solid #EEF1F6; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #F0B030, #D09010); }

/* --- Entrada suave del contenido --- */
/* fill-mode backwards: no deja transform residual en <main> (un transform permanente
   convierte a <main> en containing block y ROMPE todos los position:fixed internos:
   modales, overlays y dropdowns quedaban desplazados/invisibles = "pantalla congelada") */
main { animation: premiumFade .35s ease backwards; }
@keyframes premiumFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* === NAVBAR: fija, con blur y acentos === */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    background: linear-gradient(120deg, rgba(16,0,64,0.97) 0%, rgba(27,20,100,0.96) 55%, rgba(32,64,160,0.94) 100%) !important;
    box-shadow: 0 6px 30px rgba(16,0,64,0.35), 0 1px 0 rgba(240,176,48,0.18) inset;
}
.navbar-brand { transition: transform .25s ease; }
.navbar-brand:hover { transform: translateY(-1px); }
.brand-text { letter-spacing: .3px; }

.nav-link {
    position: relative;
    border-radius: 10px;
    padding: 8px 14px !important;
    transition: background .22s ease, color .22s ease, transform .22s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 50%; bottom: 2px;
    width: 0; height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 4px;
    transform: translateX(-50%);
    transition: width .25s ease;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff !important; transform: translateY(-1px); }
.nav-link:hover::after { width: 55%; }
.nav-link-gold { box-shadow: inset 0 0 0 1px rgba(240,176,48,0.35); }

/* --- Dropdown de usuario refinado --- */
.navbar-user-btn { border-radius: 12px; transition: background .2s, box-shadow .2s; }
.navbar-user-btn:hover { background: rgba(255,255,255,0.1); box-shadow: 0 0 0 1px rgba(240,176,48,0.3); }
.user-dropdown-menu {
    border-radius: 16px !important;
    box-shadow: 0 20px 50px rgba(16,0,64,0.28) !important;
    border: 1px solid rgba(226,232,240,0.9);
    overflow: hidden;
}
.user-dropdown-item { transition: background .18s, padding-left .18s; }
.user-dropdown-item:hover { padding-left: 22px; }

/* === BOTONES === */
.btn {
    letter-spacing: .2px;
    border-radius: 10px;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, background .18s ease;
}
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary:hover, .btn-secondary:hover, .btn-success:hover, .btn-danger:hover, .btn-warning:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 8px 20px rgba(16,0,64,0.18);
}

/* === TARJETAS === */
.card {
    border-radius: 16px !important;
    border: 1px solid rgba(226,232,240,0.8) !important;
    box-shadow: 0 2px 10px rgba(16,0,64,0.05) !important;
    transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { box-shadow: 0 10px 30px rgba(16,0,64,0.1) !important; }

/* === FORMULARIOS === */
.form-group input, .form-group select, .form-group textarea {
    border-radius: 10px !important;
    transition: border-color .2s, box-shadow .2s, background .2s !important;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 4px rgba(240,176,48,0.13) !important;
    background: #FFFDF7;
}

/* === TABLAS === */
.table-responsive { border-radius: 14px; }
table tbody tr { transition: background .15s ease; }
table tbody tr:hover { background: rgba(240,176,48,0.05); }

/* === ALERTAS === */
.alert {
    border-radius: 12px !important;
    border-left-width: 4px !important;
    box-shadow: 0 2px 10px rgba(16,0,64,0.05);
}

/* === TABS ADMIN === */
.admin-tab {
    border-radius: 10px;
    transition: all .2s ease;
}
.admin-tab:hover { transform: translateY(-1px); }
.admin-tab-active {
    box-shadow: 0 4px 14px rgba(16,0,64,0.25);
}

/* === IMAGENES / MEDIA === */
img { border-radius: 6px; }
.navbar-logo, .logo-img, footer img { border-radius: 0; }

/* === ENLACES GENERALES === */
a { transition: color .18s ease; }

/* === LOGIN / AUTH: tarjeta con borde de gradiente === */
.login-card {
    border-radius: 24px !important;
    box-shadow: 0 30px 70px -15px rgba(16,0,64,0.5), 0 0 0 1px rgba(240,176,48,0.2) !important;
    transform: translateZ(0);
}
.login-header {
    background: linear-gradient(120deg, #100040 0%, #1B1464 55%, #2040A0 100%) !important;
    border-bottom: none !important;
    position: relative;
}
.login-header::after {
    content: '';
    display: block; height: 4px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* === DASHBOARD stats tipo glass === */
.dashboard-stat {
    border-radius: 18px !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    background: rgba(255,255,255,0.08) !important;
    backdrop-filter: blur(10px);
    transition: transform .25s ease, background .25s ease;
}
.dashboard-stat:hover { transform: translateY(-3px); background: rgba(255,255,255,0.14) !important; }
.quick-link { box-shadow: 0 6px 22px rgba(16,0,64,0.18); border-radius: 18px !important; }
.quick-link:hover { box-shadow: 0 14px 36px rgba(16,0,64,0.28); }
.quick-link-icon {
    width: 56px; height: 56px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 16px;
    font-size: 24px !important;
    backdrop-filter: blur(6px);
}
.quick-link:hover .quick-link-icon { background: rgba(255,255,255,0.18); transform: scale(1.05); }
.quick-link-icon { transition: background .2s, transform .25s; }

/* === FOOTER refinado === */
footer { border-top: 3px solid var(--gold); }
footer a:hover { color: var(--gold) !important; padding-left: 2px; }

/* === SECCIONES / headers === */
.section-header h2, .card h3 { letter-spacing: -0.3px; }

/* === TEXTURA DE FONDO GLOBAL (sutil) === */
body {
    background-color: #FBFAF6;
    background-image:
        radial-gradient(900px 480px at 105% -5%, rgba(240,176,48,0.05), transparent 60%),
        radial-gradient(760px 520px at -12% 40%, rgba(32,64,160,0.035), transparent 60%);
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* === ANIMACION DE APARICION AL SCROLL === */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .45s cubic-bezier(.22,.9,.32,1); }
.rv.on { opacity: 1; transform: none; }

/* === REDUCIR MOVIMIENTO si el usuario lo prefiere === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
