
/* 1. RESET Y BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, 
        rgba(0, 123, 255, 0.95) 0%, 
        rgba(70, 130, 255, 0.8) 30%, 
        rgba(173, 216, 230, 0.7) 60%,
        rgba(255, 255, 255, 0.95) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2d3436;
    padding: 2rem;
    line-height: 1.6;
}

/* 2. MENÚ LATERAL */
.nav * { text-decoration: none !important; color: inherit !important; }

.nav {
    position: fixed; top: 0; left: 0;
    width: 280px; height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(25px);
    border-right: 1px solid rgba(0, 123, 255, 0.3);
    box-shadow: 4px 0 20px rgba(0, 123, 255, 0.2);
    padding: 1.5rem 0; z-index: 1000;
    transform: translateX(-100%);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: none;
    overflow-x: none;
}

.nav.open { transform: translateX(0); }

.layout {
    display: flex; flex-direction: column;
    gap: 0; padding: 0 1rem;
}

.layout_primary {
    padding: 1rem 1.5rem; background: rgba(0, 123, 255, 0.4);
    border-radius: 12px; margin: 0 1rem 1rem 1rem;
    cursor: pointer; font-weight: 600; color: white;
    transition: all 0.3s ease; position: relative; z-index: 1;
}

.layout_primary:hover {
    background: rgba(0, 123, 255, 0.6);
    transform: translateX(5px);
}

.layout_primary summary,
.layout_items, .layout_title {
    display: block; width: 100%;
    position: relative; z-index: 1; cursor: pointer;
}

.layout_primary summary {
    padding: 1rem; list-style: none;
    outline: none; font-weight: 600; color: white;
}

.layout_items {
    padding: 1rem 1.5rem; background: rgba(0, 123, 255, 0.1);
    backdrop-filter: blur(12px); border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 500; border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 0.25rem 0;
}

.layout_items::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: inherit; transform: scale(0);
    transition: all 0.3s ease; z-index: -1;
}

.layout_items::after {
    content: ''; position: absolute;
    bottom: 0; left: 50%; width: 0; height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    transition: all 0.3s ease; transform: translateX(-50%);
}

.layout_items:hover {
    background: rgba(0, 123, 255, 0.6);
    color: white; transform: translateX(8px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

.layout_items:hover::before { transform: scale(1); }
.layout_items:hover::after { width: 80%; }

.layout_title {
    list-style: none; cursor: pointer;
    padding: 1rem 2.5rem 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(12px); border-radius: 12px;
    font-weight: 600; transition: all 0.3s ease;
    margin: 0.25rem 0;
}

.layout_title::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: inherit; transform: scale(0);
    transition: all 0.3s ease; z-index: -1;
}

.layout_title::after {
    content: '▾'; position: absolute;
    right: 1.5rem; transition: transform 0.3s ease;
}

details[open] .layout_title::after { transform: rotate(180deg); }

.layout_title:hover {
    background: rgba(0, 123, 255, 0.4); color: white;
}
.layout_title:hover::before { transform: scale(1); }

details[open] .layout_items {
    margin: 0.25rem 1rem; background: rgba(255, 255, 255, 0.2);
    border-radius: 8px; animation: slideDown 0.3s ease-out;
}

details > summary::-webkit-details-marker,
summary::-webkit-details-marker { display: none; list-style: none; }

/* 3. HAMBURGUESA */
.menu-toggle {
    position: fixed; top: 20px; left: 20px;
    z-index: 1001; background: rgba(0, 123, 255, 0.9);
    border: none; border-radius: 12px;
    width: 50px; height: 50px; color: white;
    font-size: 1.2rem; cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.6);
}

/* 4. CONTENIDO */
h1 {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 4rem);
    
    /* GRADIENTE ANIMADO */
    background: linear-gradient(
        -45deg, 
        #007bff, #0056b3, #00d4ff, #0099cc, 
        #007bff, #0056b3
    );
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    
    margin-bottom: 2rem;
    font-weight: 700;
    
    /* ANIMACIONES MÚLTIPLES */
    animation: 
        gradientFlow 3s ease-in-out infinite,
        slideInUp 0.8s ease-out,
        floatGlow 6s ease-in-out infinite;
}

p {
    max-width: 800px; font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px); padding: 1.5rem;
    border-radius: 16px; margin: 0 auto 1.5rem;
    border-left: 4px solid rgba(0, 123, 255, 0.6);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
}

main {
    max-width: 1200px; margin: 0 auto;
    padding: 0 1rem; animation: slideInUp 0.6s ease-out;
}

/* 5. FORMULARIOS */
.form {
    margin: 2rem auto; max-width: 600px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px); border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 123, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 2.5rem; animation: slideInUp 0.6s ease-out;
}

.form_items {
    margin-bottom: 2rem; display: flex;
    flex-direction: column; gap: 0.5rem;
}

.form_items label {
    font-weight: 600; color: #2d3436;
    margin-bottom: 0.25rem; font-size: 0.95rem;
    text-transform: uppercase; letter-spacing: 0.5px;
}

/* INPUTS UNIFICADOS */
input, select, textarea {
    padding: 1.2rem 1.5rem; border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px; background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(12px); color: #2d3436;
    font-size: 1rem; transition: all 0.3s ease;
    width: 100%; font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none; background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    transform: translateY(-2px); border-color: rgba(0, 123, 255, 0.6);
}

select {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%232d3436' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat; background-size: 1.2em;
    padding-right: 3rem;
}

input::placeholder { color: rgba(45, 52, 54, 0.6); }

button[type="submit"] {
    width: 100%; padding: 1.2rem 2rem;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.9), rgba(70, 130, 255, 0.8));
    backdrop-filter: blur(12px); border: none; border-radius: 16px;
    color: white; font-size: 1.1rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    margin-top: 1rem;
}

button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 123, 255, 0.6);
    background: linear-gradient(135deg, rgba(0, 123, 255, 1), rgba(70, 130, 255, 0.9));
}

/* 6. BOTONES */
.conteiner {
    display: flex; gap: 1rem;
    justify-content: center; margin: 2rem 0;
    flex-wrap: wrap;
}

.agregar {
    position: relative; padding: 1rem 2rem;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.9), rgba(70, 130, 255, 0.8));
    backdrop-filter: blur(12px); border: none; border-radius: 16px;
    color: white; font-size: 1rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    overflow: hidden; min-width: 120px; text-align: center;
}

.agregar a {
    display: block; width: 100%; height: 100%;
    color: white !important; text-decoration: none !important;
    padding: 0.5rem 1rem;
}

.agregar:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 123, 255, 0.6);
    background: linear-gradient(135deg, rgba(0, 123, 255, 1), rgba(70, 130, 255, 0.9));
}

.agregar:active { transform: translateY(-1px); }

.agregar:last-child {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.9), rgba(255, 99, 99, 0.8));
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.agregar:last-child:hover {
    background: linear-gradient(135deg, rgba(220, 53, 69, 1), rgba(255, 99, 99, 0.9));
    box-shadow: 0 12px 35px rgba(220, 53, 69, 0.6);
}

/* 7. TABLAS CENTRADAS */
table {
    width: 100%;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 123, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    margin-top: 2rem;
    font-size: 1.2rem;
}

caption {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.8), rgba(70, 130, 255, 0.7));
    color: white;
    padding: 1.5rem;
    font-weight: 600;
    font-size: 1.2rem;
    text-align: left;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

thead th {
    background: rgba(0, 123, 255, 0.6);
    color: white;
    padding: 1.5rem 1.2rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

tbody td {
    border: none !important;
    padding: 1.2rem 1rem;
    background: transparent !important;
    position: relative;
    z-index: 1;
}

tbody tr:hover {
    background: rgba(0, 123, 255, 0.15) !important;
    transform: scale(1.01);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.2);
    border-radius: 12px;
    position: relative;
    z-index: 5;
    margin-bottom: 0.5rem;
}

tfoot td {
    border-top: 2px solid rgba(0, 123, 255, 0.3);
}
/* 8. ANIMACIONES */

@keyframes gradientFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes floatGlow {
    0%, 100% { 
        transform: translateY(0px) scale(1);
        filter: drop-shadow(0 0 10px rgba(0, 123, 255, 0.3));
    }
    50% { 
        transform: translateY(-10px) scale(1.02);
        filter: drop-shadow(0 0 30px rgba(0, 123, 255, 0.6));
    }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

h1, p, .form, main, table { animation: slideInUp 0.8s ease-out; }

/* 9. RESPONSIVE */
@media (max-width: 768px) {
    body { padding: 1rem; }
    
    .nav.open .layout_items, .nav.open .layout_title {
        padding: 1.2rem 2rem;
    }
    
    .nav, .form { max-width: 100%; margin: 0 1rem 2rem 1rem; }
    
    table {
        width: 100%; max-width: none;
        margin: 1rem 0; display: block;
        overflow-x: auto; white-space: nowrap;
        border-radius: 16px;
    }
    
    tbody tr { display: table-row; margin-bottom: 0.5rem; }
    tbody tr:hover { transform: none; margin-bottom: 0.75rem; }
    
    .conteiner { flex-direction: column; align-items: center; }
    .agregar { width: 100%; max-width: 300px; }
    
    thead th, tbody td {
        padding: 0.8rem 0.6rem; min-width: 80px;
        white-space: nowrap;
    }
}
