@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700;900&family=Montserrat:wght@700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    font-family:'Lato', sans-serif;
    min-height:100vh;
    background:linear-gradient(135deg,#889bb0 0%,#acbfd4 100%);
    color:#15253f;

    display:flex;
    flex-direction:column;
}

header {
    background: linear-gradient(135deg, #263042 0%, #15253f 100%);
    padding: 20px 25px;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.banner h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    margin-bottom: 12px;
}

nav ul {
    display: flex;
    list-style: none;
    justify-content: center;
    flex-wrap: wrap;
    gap: 22px;
}

nav a {
    color: #fff;
    font-size: 0.95rem;
    text-decoration: none;
    font-weight: 700;
}

nav a:hover,
nav a.active {
    color: #ffd166;
}

main.main-categorias {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 24px;
    padding: 25px;
    flex: 1;
}

.panel{
    background: rgba(255,255,255,.95);
    border-radius:18px;
    padding:24px;
    box-shadow:0 10px 25px rgba(0,0,0,.12);
}

.panel-formulario h2,
.panel-lista h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 18px;
    color: #263042;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-group label {
    font-weight: 700;
    color: #263042;
    font-size: 0.95rem;
}

.form-group input {
    padding: 12px 14px;
    border: 1px solid #c6d0df;
    border-radius: 10px;
    font-size: 0.95rem;
    background: #f4f7fb;
    color: #15253f;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #889bb0;
    outline: none;
    box-shadow: 0 0 0 4px rgba(136, 155, 176, 0.12);
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn{
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-size: 15px;
    font-weight: bold;
    transition:
        background .25s ease,
        transform .20s ease,
        box-shadow .20s ease;
}

.btn:hover{
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,.15);
}

.btn-primary {
    background: linear-gradient(135deg, #889bb0 0%, #acbfd4 100%);
    color: #15253f;
}

.btn-secondary {
    background: #ffffff;
    color: #263042;
    border: 1px solid #c6d0df;
}

.btn-secondary:hover,
.btn-primary:hover,
.btn-tertiary:hover {
    opacity: 0.92;
}

.btn-tertiary {
    background: #e7edf6;
    color: #263042;
    border: 1px solid #c6d0df;
}

.nota{

    margin-top:18px;

    padding:14px;

    background:#edf4fb;

    border-left:5px solid #889bb0;

    border-radius:8px;

    font-size:.92rem;

    color:#334155;

    line-height:1.5;

}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.categorias-tree {
    margin-top: 10px;
}

.categoria-contenido{

    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:14px 18px;

    background:#f8fafc;

    border:1px solid #d9e2ef;

    border-radius:12px;

    margin-bottom:12px;

    transition:
        transform .20s ease,
        box-shadow .20s ease;

}

.categoria-contenido:hover{

    transform:translateY(-2px);

    box-shadow:0 8px 18px rgba(0,0,0,.10);

}

.categoria-nombre {
    font-weight: 700;
    color: #15253f;
    display: inline-block;
}

.categoria-nombre::before{

    content:"📁 ";

}

.categoria-acciones {
    display: flex;
    gap: 10px;
}

.btn-eliminar-cat{

    width:38px;

    height:38px;

    border:none;

    border-radius:10px;

    background:#ff6b6b;

    color:white;

    cursor:pointer;

    display:flex;

    justify-content:center;

    align-items:center;

    font-size:18px;

    transition:
        background .20s ease,
        transform .20s ease;

}

.btn-eliminar-cat:hover{

    background:#e63946;

    transform:scale(1.08);

}

.sin-categorias {
    padding: 18px;
    text-align: center;
    border-radius: 12px;
    background: #f4f7fb;
    color: #475569;
    font-size: 0.95rem;
}

.alerta{

    padding:14px;

    border-radius:10px;

    margin-bottom:18px;

    font-weight:bold;

    animation:fade .3s ease;

}

.alerta-success {
    background: #d1fae5;
    color: #065f46;
}

.alerta-error {
    background: #fee2e2;
    color: #991b1b;
}

footer {
    padding: 18px 25px;
    background: linear-gradient(135deg, #263042 0%, #15253f 100%);
    color: #fff;
}

.bottom-menu ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 18px;
    flex-wrap: wrap;
}

.bottom-menu a {
    color: #f8fafc;
    font-size: 0.85rem;
    text-decoration: none;
}

.bottom-menu a:hover {
    color: #ffd166;
}

@media(max-width:900px){

    .banner h1{
        text-align: center;
    }

    main.main-categorias{

        grid-template-columns:1fr;

        padding:18px;

    }

    .panel{

        padding:18px;

    }

}

@media(max-width:600px){

    .banner h1{
        text-align: center;
    }

    nav ul{

        gap:12px;

    }

    .button-group{

        flex-direction:column;

    }

    .btn{

        width:100%;

    }

    .categoria-contenido{

        flex-direction:column;

        align-items:flex-start;

        gap:12px;

    }

    .categoria-acciones{

        width:100%;

        display:flex;

        justify-content:flex-end;

    }

}

@keyframes fade{

    from{

        opacity:0;

        transform:translateY(-8px);

    }

    to{

        opacity:1;

        transform:translateY(0);

    }

}
