:root {
    --fondo: #0b1220;
    --fondo-secundario: #111827;
    --tarjeta: rgba(17, 24, 39, 0.95);
    --borde: rgba(59, 130, 246, 0.2);

    --azul: #3b82f6;
    --azul-hover: #2563eb;

    --oro: #d4af37;
    --oro-hover: #c79d17;

    --texto: #0f77de;
    --texto-secundario: #94a3b8;

    --error: #320cca;
    --exito: #22c55e;

    --radio: 16px;
    --sombra: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #070d16, #111827);
    color: var(--texto);
    min-height: 100vh;
}

/* ==========================
   FONDO
========================== */

.fondo-roy {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.fondo-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.fondo-logo {
    position: absolute;
    width: 400px;
    opacity: .04;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.fondo-eslogan {
    position: absolute;
    bottom: 30px;
    width: 100%;
    text-align: center;
    color: var(--texto-secundario);
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ==========================
   TARJETAS
========================== */

.tarjeta {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 25px;
    backdrop-filter: blur(12px);
    box-shadow: var(--sombra);
}

.vista-sin-acceso {
    width: min(1400px, 95%);
    margin: 40px auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 25px;
}

.logo-acceso {
    width: 120px;
    display: block;
    margin: 0 auto 20px;
}

/* ==========================
   TITULOS
========================== */

h1,
h2,
h3 {
    margin-bottom: 15px;
}

.subtitulo {
    color: var(--texto-secundario);
    margin-bottom: 20px;
}

/* ==========================
   FORMULARIOS
========================== */

.formulario {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: .95rem;
    color: var(--texto-secundario);
}

input,
textarea,
select {
    width: 100%;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 12px 14px;
    color: rgb(255, 255, 255);
    font-size: .95rem;
    transition: .3s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

textarea {
    resize: vertical;
}

.fila-dos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.campo-ayuda {
    color: var(--texto-secundario);
    font-size: .8rem;
}

/* ==========================
   BOTONES
========================== */

.btn {
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: .3s;
}

.btn-primario {
    background: var(--azul);
    color: rgb(255, 255, 255);
}

.btn-primario:hover {
    background: var(--azul-hover);
}

.btn-secundario {
    background: #334155;
    color: rgb(255, 255, 255);
}

.btn-secundario:hover {
    background: #475569;
}

.btn-oro {
    background: var(--oro);
    color: black;
}

.btn-oro:hover {
    background: var(--oro-hover);
}

.btn-logout {
    background: #dc2626;
}

.btn-logout:hover {
    background: #b91c1c;
}

/* ==========================
   MENSAJES
========================== */

.mensaje-error {
    color: var(--error);
    font-size: .9rem;
}

.mensaje-exito {
    color: var(--exito);
    font-size: .9rem;
}

.oculto {
    display: none !important;
}

/* ==========================
   NAVBAR
========================== */

.barra-navegacion {
    background: rgba(10, 15, 25, .95);
    border-bottom: 1px solid var(--borde);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-marca {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    font-size: 1.1rem;
}

.nav-logo {
    width: 42px;
}

.nav-enlaces {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255,255,255,.05);
    color: rgb(14, 14, 14);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: .3s;
}

.nav-btn:hover {
    background: rgba(255,255,255,.1);
}

/* ==========================
   CONTENIDO
========================== */

.app-contenido {
    width: min(1400px, 95%);
    margin: 30px auto;
}

.vista-seccion {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* ==========================
   TABLAS
========================== */

.tabla-contenedor {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: rgba(59,130,246,.15);
}

th,
td {
    padding: 14px;
    text-align: left;
}

tbody tr {
    border-top: 1px solid rgba(255,255,255,.05);
}

tbody tr:hover {
    background: rgba(255,255,255,.03);
}

/* ==========================
   CHAT
========================== */

.chat-box {
    margin-top: 20px;
    height: 350px;
    overflow-y: auto;
    background: rgba(255,255,255,.03);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255,255,255,.08);
}

/* ==========================
   ADMIN
========================== */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================
   RESPONSIVE
========================== */

@media (max-width: 768px) {

    .fila-dos {
        grid-template-columns: 1fr;
    }

    .barra-navegacion {
        flex-direction: column;
        gap: 15px;
    }

    .nav-enlaces {
        justify-content: center;
    }

    .admin-header {
        flex-direction: column;
        gap: 15px;
    }
}

/* Control de vistas */

.vista-seccion {
    display: none;
}

.vista-seccion.activa {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Botón activo de navegación */

.nav-btn.activo {
    background: var(--azul);
    border-color: var(--azul);
    color: rgb(91, 10, 198);
}