*{box-sizing:border-box}

:root{
    --main:#7c3aed;
    --main2:#a855f7;
    --bg:#060816;
    --panel:#0f172a;
    --text:#ffffff;
    --muted:#94a3b8;
    --border:rgba(255,255,255,.10);
}

body{
    margin:0;
    font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
    background:var(--bg);
    color:var(--text);
}

a{
    color:inherit;
    text-decoration:none;
}

button,a{
    -webkit-tap-highlight-color:transparent;
}

/* PORTADA */

.welcome-body{
    min-height:100vh;
    background:
        radial-gradient(circle at 15% 10%, rgba(124,58,237,.35), transparent 30%),
        radial-gradient(circle at 85% 20%, rgba(168,85,247,.25), transparent 35%),
        linear-gradient(135deg,#09051f,#080b16 55%,#020617);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
}

.welcome-layout{
    width:100%;
    max-width:980px;
    display:flex;
    justify-content:center;
}

.book-stage{
    width:100%;
    max-width:760px;
    min-height:520px;
    position:relative;
    display:flex;
    filter:drop-shadow(0 35px 55px rgba(0,0,0,.75));
}

.book-spine{
    width:76px;
    border-radius:28px 0 0 28px;
    background:linear-gradient(90deg,#2b160c,#6b3f1f,#2b160c);
    box-shadow:inset -12px 0 20px rgba(0,0,0,.35),inset 10px 0 18px rgba(255,255,255,.08);
    border:1px solid rgba(255,215,150,.18);
}

.book-cover{
    flex:1;
    position:relative;
    overflow:hidden;
    padding:58px 56px;
    border-radius:0 30px 30px 0;
    background:
        linear-gradient(145deg,rgba(255,255,255,.08),transparent 22%),
        radial-gradient(circle at 70% 10%,rgba(255,225,160,.12),transparent 30%),
        linear-gradient(135deg,#6d421f,#8a5a2f 45%,#4b2612);
    border:1px solid rgba(255,225,180,.20);
}

.book-cover:before{
    content:"";
    position:absolute;
    inset:20px;
    border:1px solid rgba(255,232,190,.22);
    border-radius:20px;
    pointer-events:none;
}

.book-cover:after{
    content:"";
    position:absolute;
    inset:-40%;
    background:linear-gradient(115deg,transparent 40%,rgba(255,255,255,.10),transparent 60%);
    transform:rotate(12deg);
    pointer-events:none;
}

.book-border{
    position:absolute;
    inset:34px;
    border-radius:18px;
    border:1px solid rgba(255,255,255,.10);
    pointer-events:none;
}

.book-cover>*{
    position:relative;
    z-index:2;
}

.brand-badge{
    display:inline-flex;
    align-items:center;
    gap:10px;
    padding:10px 16px;
    border-radius:999px;
    background:rgba(0,0,0,.24);
    border:1px solid rgba(255,255,255,.22);
    color:#fff;
    font-weight:700;
}

.brand-icon{
    width:28px;
    height:28px;
    border-radius:9px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:12px;
    font-weight:900;
    background:linear-gradient(135deg,var(--main),var(--main2));
}

.book-cover h1{
    margin:54px 0 20px;
    max-width:650px;
    font-size:clamp(38px,6vw,68px);
    line-height:.98;
    letter-spacing:-2px;
}

.book-cover p{
    margin:0;
    max-width:590px;
    font-size:19px;
    line-height:1.5;
    color:#fff4df;
}

.cover-actions{
    display:flex;
    flex-wrap:wrap;
    gap:14px;
    margin-top:34px;
}

/* BOTONES */

.btn{
    min-height:46px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:none;
    cursor:pointer;
    border-radius:15px;
    padding:12px 18px;
    font-weight:900;
    font-size:14px;
    transition:.18s ease;
}

.btn:hover{
    transform:translateY(-2px);
}

.btn.primary{
    background:linear-gradient(135deg,var(--main),var(--main2));
    color:#fff;
    box-shadow:0 12px 25px rgba(124,58,237,.30);
}

.btn.ghost{
    background:rgba(255,255,255,.12);
    border:1px solid rgba(255,255,255,.18);
    color:#fff;
}

.btn.full{
    width:100%;
}

.btn.small{
    min-height:auto;
    padding:8px 13px;
    font-size:13px;
    border-radius:12px;
}

.whatsapp-mini{
    display:inline-block;
    margin-top:28px;
    color:#fef3c7;
    font-weight:700;
}

/* LOGIN */

.auth-body{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    background:
        radial-gradient(circle at top,rgba(124,58,237,.35),transparent 35%),
        linear-gradient(135deg,#0f062a,#020617);
    padding:20px;
}

.auth-card{
    width:100%;
    max-width:440px;
    background:rgba(15,23,42,.94);
    border:1px solid var(--border);
    border-radius:26px;
    padding:30px;
    box-shadow:0 25px 70px rgba(0,0,0,.60);
}

.auth-card.wide{
    max-width:650px;
}

.auth-card h1{
    margin:0 0 8px;
    font-size:32px;
}

.auth-card p{
    margin:0 0 22px;
    color:var(--muted);
}

label{
    display:block;
    margin-top:14px;
    color:#cbd5e1;
    font-weight:800;
}

input,textarea,select{
    width:100%;
    margin-top:8px;
    border:none;
    outline:none;
    border-radius:14px;
    background:#111827;
    border:1px solid rgba(255,255,255,.10);
    color:#fff;
    padding:14px;
    font-size:15px;
}

textarea{
    min-height:110px;
    resize:vertical;
}

.alert{
    padding:13px;
    border-radius:14px;
    background:#7f1d1d;
    color:#fff;
    margin:14px 0;
}

.auth-links{
    margin-top:18px;
    display:flex;
    justify-content:space-between;
    gap:12px;
    color:#c4b5fd;
}

.checks{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
    gap:10px;
}

.checks label{
    margin:0;
    padding:12px;
    background:#111827;
    border:1px solid rgba(255,255,255,.08);
    border-radius:14px;
}

/* APP */

.app-body{
    min-height:100vh;
    background:
        radial-gradient(circle at top left,rgba(124,58,237,.18),transparent 30%),
        #060816;
}

/* SIDEBAR PC */

.sidebar{
    width:270px;
    height:100vh;
    padding:18px;
    position:fixed;
    left:0;
    top:0;
    z-index:1000;
    overflow-y:auto;
    background:rgba(15,23,42,.96);
    border-right:1px solid var(--border);
}

.sidebar-profile{
    display:flex;
    align-items:center;
    gap:12px;
    padding:14px;
    margin-bottom:16px;
    border-radius:20px;
    background:rgba(255,255,255,.06);
    border:1px solid rgba(255,255,255,.08);
}

.profile-avatar{
    width:48px;
    height:48px;
    border-radius:16px;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    font-weight:900;
    font-size:22px;
    background:linear-gradient(135deg,var(--main),var(--main2));
    color:white;
}

.profile-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.profile-name{
    font-weight:900;
    font-size:15px;
    max-width:160px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.profile-plan{
    margin-top:3px;
    display:inline-block;
    font-size:11px;
    font-weight:900;
    letter-spacing:.8px;
    color:#fef3c7;
}

.menu-title{
    margin:18px 10px 8px;
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:1.4px;
    color:#64748b;
    font-weight:900;
}

.menu a{
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px 13px;
    border-radius:15px;
    color:#cbd5e1;
    margin-bottom:7px;
    font-weight:800;
}

.menu a:hover,
.menu a.active{
    background:linear-gradient(135deg,var(--main),var(--main2));
    color:#fff;
}

.menu-icon{
    width:30px;
    height:30px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:10px;
    background:rgba(255,255,255,.07);
    flex:none;
    font-size:11px;
    font-weight:950;
}

.menu a.active .menu-icon,
.menu a:hover .menu-icon{
    background:rgba(255,255,255,.18);
}

/* CONTENIDO */

.content{
    width:calc(100% - 270px);
    margin-left:270px;
    padding:28px;
}

.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:15px;
    margin-bottom:24px;
}

.topbar h1{
    margin:0;
    font-size:34px;
}

.topbar p{
    margin:6px 0 0;
    color:var(--muted);
}

.top-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.cards{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
    gap:16px;
    margin-bottom:22px;
}

.card,.panel,.photo-card,.quick-card{
    background:rgba(15,23,42,.92);
    border:1px solid var(--border);
    border-radius:24px;
    padding:20px;
    box-shadow:0 14px 40px rgba(0,0,0,.25);
}

.hero-panel p{
    font-size:18px;
    line-height:1.6;
    margin-bottom:0;
}

.card strong{
    display:block;
    font-size:38px;
}

.card span{
    color:var(--muted);
}

.panel{
    margin-bottom:22px;
}

.panel h2{
    margin-top:0;
}

.list-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    padding:14px 0;
    border-bottom:1px solid rgba(255,255,255,.08);
}

.list-row:last-child{
    border-bottom:none;
}

.list-row small{
    display:block;
    margin-top:5px;
    color:var(--muted);
}

.quick-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
    gap:16px;
    margin-bottom:22px;
}

.quick-card{
    display:block;
}

.quick-card b{
    display:block;
    width:44px;
    height:44px;
    border-radius:16px;
    background:linear-gradient(135deg,var(--main),var(--main2));
    display:flex;
    align-items:center;
    justify-content:center;
    margin-bottom:10px;
}

.quick-card span{
    color:#cbd5e1;
    font-weight:800;
}

.grid-form{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
    gap:14px;
}

.full-grid{
    grid-column:1/-1;
}

.gallery{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:16px;
    margin-top:20px;
}

.photo-card img{
    width:100%;
    height:180px;
    object-fit:cover;
    border-radius:18px;
}

/* MOVIL APP */

@media(max-width:820px){

    .app-body{
        padding-bottom:82px;
    }

    .sidebar{
        position:fixed;
        left:0;
        right:0;
        top:auto;
        bottom:0;
        width:100%;
        height:76px;
        padding:8px;
        overflow-x:auto;
        overflow-y:hidden;
        border-right:none;
        border-top:1px solid rgba(255,255,255,.12);
        background:rgba(15,23,42,.98);
        backdrop-filter:blur(14px);
    }

    .sidebar-profile,
    .menu-title{
        display:none;
    }

    .menu{
        display:flex;
        gap:8px;
        width:max-content;
        min-width:100%;
    }

    .menu a{
        min-width:72px;
        height:58px;
        padding:6px 7px;
        margin:0;
        border-radius:16px;
        display:flex;
        flex-direction:column;
        align-items:center;
        justify-content:center;
        gap:4px;
        font-size:10px;
        text-align:center;
    }

    .menu-icon{
        width:25px;
        height:22px;
        background:transparent;
        font-size:10px;
    }

    .content{
        width:100%;
        margin-left:0;
        padding:14px;
    }

    .topbar{
        align-items:flex-start;
        margin-bottom:16px;
    }

    .topbar h1{
        font-size:24px;
        line-height:1.1;
    }

    .topbar p{
        font-size:13px;
    }

    .top-actions{
        flex-direction:column;
        align-items:flex-end;
        gap:8px;
    }

    .top-actions .btn{
        min-height:38px;
        padding:9px 11px;
        font-size:12px;
        border-radius:12px;
        white-space:nowrap;
    }

    .panel{
        border-radius:18px;
        padding:15px;
        margin-bottom:14px;
    }

    .panel h2{
        font-size:18px;
    }

    .hero-panel p{
        font-size:15px;
    }

    .cards{
        grid-template-columns:repeat(2,1fr);
        gap:10px;
        margin-bottom:14px;
    }

    .card{
        border-radius:18px;
        padding:14px;
    }

    .card strong{
        font-size:28px;
    }

    .card span{
        font-size:13px;
    }

    .quick-grid{
        grid-template-columns:repeat(2,1fr);
        gap:10px;
    }

    .quick-card{
        border-radius:18px;
        padding:14px;
    }

    .quick-card b{
        width:38px;
        height:38px;
        border-radius:14px;
    }

    .list-row{
        align-items:flex-start;
        flex-direction:column;
    }

    .welcome-body{
        padding:14px;
        align-items:flex-start;
    }

    .book-stage{
        min-height:auto;
        margin-top:20px;
    }

    .book-spine{
        width:28px;
        border-radius:22px 0 0 22px;
    }

    .book-cover{
        padding:38px 28px;
        border-radius:0 22px 22px 0;
    }

    .book-cover h1{
        margin-top:40px;
        font-size:42px;
        letter-spacing:-1px;
    }

    .book-cover p{
        font-size:16px;
    }

    .cover-actions{
        flex-direction:column;
    }

    .cover-actions .btn{
        width:100%;
    }
}
/* SIDEBAR PC + NAV MOVIL */

.desktop-sidebar{
    display:block;
}

.mobile-nav{
    display:none;
}

@media(max-width:820px){

    .desktop-sidebar{
        display:none !important;
    }

    .content{
        margin-left:0 !important;
        width:100% !important;
        padding:14px !important;
        padding-bottom:92px !important;
    }

    .mobile-nav{
        position:fixed;
        left:10px;
        right:10px;
        bottom:10px;
        z-index:99999;
        height:68px;
        display:grid;
        grid-template-columns:repeat(5,1fr);
        gap:7px;
        padding:8px;
        border-radius:24px;
        background:rgba(15,23,42,.96);
        border:1px solid rgba(255,255,255,.12);
        box-shadow:0 18px 45px rgba(0,0,0,.55);
        backdrop-filter:blur(14px);
    }

    .mobile-nav a{
        display:flex;
        flex-direction:column;
        align-items:center;
        justify-content:center;
        gap:3px;
        border-radius:17px;
        color:#cbd5e1;
        font-weight:900;
        font-size:11px;
    }

    .mobile-nav a span{
        width:26px;
        height:24px;
        display:flex;
        align-items:center;
        justify-content:center;
        border-radius:10px;
        background:rgba(255,255,255,.07);
        font-size:10px;
    }

    .mobile-nav a small{
        font-size:10px;
        line-height:1;
    }

    .mobile-nav a.active{
        background:linear-gradient(135deg,var(--main),var(--main2));
        color:#fff;
    }

    .mobile-nav a.active span{
        background:rgba(255,255,255,.20);
    }
}