:root{
    --primary:#454a9a;
    --primary-dark:#30367a;
    --bg:#f5f7fb;
    --card:#ffffff;
    --text:#263238;
    --muted:#6c757d;
    --border:#e6e9ef;
    --sidebar-width:280px;
}

*{
    box-sizing:border-box;
}

body{
    background:var(--bg);
    font-family:'Segoe UI',sans-serif;
    color:var(--text);
    margin:0;
}

.app-navbar{
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
    height:60px;
    position:sticky;
    top:0;
    z-index:1050;
}

.btn-menu{
    background:#ffffff;
    color:var(--primary);
    border:none;
    border-radius:12px;
    width:42px;
    height:38px;
}

.btn-menu:hover{
    background:#eef4ff;
    color:var(--primary-dark);
}

.top-user{
    font-size:14px;
}

.app-wrapper{
    display:flex;
    min-height:calc(100vh - 60px);
}

.sidebar{
    width:var(--sidebar-width);
    background:#ffffff;
    border-right:1px solid var(--border);
    min-height:calc(100vh - 60px);
    flex-shrink:0;
    overflow-y:auto;
    transition:.25s ease;
}

.main-content{
    flex:1;
    min-width:0;
}

.page-content{
    padding:25px;
}

.card-dashboard,
.app-card{
    border:none;
    border-radius:20px;
    box-shadow:0 6px 18px rgba(16,24,40,.08);
    background:var(--card);
}

.card-dashboard .card-body{
    padding:22px;
}

.card-dashboard h6{
    color:var(--muted);
    margin-bottom:8px;
    font-weight:700;
}

.card-dashboard h2{
    font-weight:800;
    margin-bottom:4px;
}

.card-dashboard small{
    color:var(--muted);
}

.dashboard-icon{
    width:42px;
    height:42px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin-bottom:12px;
    color:white;
    font-size:20px;
}

.card-blue .dashboard-icon{
    background:#0d6efd;
}

.card-gold .dashboard-icon{
    background:#f0ad00;
}

.card-green .dashboard-icon{
    background:#198754;
}

.card-red .dashboard-icon{
    background:#dc3545;
}

.welcome-box{
    background:#ffffff;
    border-radius:24px;
    padding:24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    box-shadow:0 6px 18px rgba(16,24,40,.08);
}

.welcome-icon{
    width:70px;
    height:70px;
    border-radius:22px;
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:32px;
}

.quick-link{
    min-height:115px;
    border-radius:20px;
    background:#f8fbff;
    border:1px solid #e5efff;
    text-decoration:none;
    color:#263238;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:10px;
    transition:.2s ease;
    font-weight:700;
}

.quick-link i{
    font-size:28px;
    color:var(--primary);
}

.quick-link:hover{
    background:#eef4ff;
    color:var(--primary);
    transform:translateY(-3px);
    box-shadow:0 8px 18px rgba(13,110,253,.15);
}

/* OVERLAY MÓVIL */

.mobile-overlay{
    display:none;
}

/* SIDEBAR KIOSKO */

.km-sidebar{
    background:#17233b !important;
    color:#ffffff !important;
    overflow-y:auto;
    scrollbar-width:thin;
    position:relative;
}

.km-sidebar *{
    box-sizing:border-box;
}

.km-brand{
    padding:16px 14px 12px;
    display:flex;
    align-items:center;
    gap:12px;
    min-height:76px;
}

.km-logo-box{
    width:52px;
    height:52px;
    min-width:52px;
    border-radius:18px;
    background:rgba(255,255,255,.12);
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

.km-logo-box .sidebar-logo{
    width:38px !important;
    height:38px !important;
    max-width:38px !important;
    max-height:38px !important;
    object-fit:contain !important;
    display:block !important;
    margin:0 !important;
}

.km-brand-text{
    min-width:0;
    flex:1;
}

.km-brand h6{
    margin:0;
    font-weight:800;
    letter-spacing:.2px;
    font-size:18px;
    line-height:1.1;
    color:#ffffff;
    white-space:nowrap;
}

.km-brand small{
    display:block;
    color:rgba(255,255,255,.72);
    font-size:12px;
    line-height:1.2;
}

.km-user-card{
    margin:8px 14px 14px;
    padding:12px;
    border-radius:20px;
    background:rgba(255,255,255,.10);
    display:flex;
    align-items:center;
    gap:12px;
    border:1px solid rgba(255,255,255,.08);
}

.km-user-avatar{
    width:44px;
    height:44px;
    min-width:44px;
    border-radius:15px;
    background:rgba(255,255,255,.18);
    display:flex;
    align-items:center;
    justify-content:center;
}

.km-user-avatar i{
    font-size:18px !important;
    line-height:1 !important;
    margin:0 !important;
    width:auto !important;
    height:auto !important;
}

.km-user-info{
    min-width:0;
    flex:1;
}

.km-user-info strong{
    display:block;
    font-size:14px;
    line-height:1.2;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.km-user-info small{
    display:block;
    color:rgba(255,255,255,.68);
    font-size:12px;
    line-height:1.2;
}

.km-search-box{
    margin:0 14px 14px;
    min-height:44px;
    border-radius:16px;
    background:rgba(255,255,255,.11);
    display:flex;
    align-items:center;
    gap:10px;
    padding:0 13px;
    border:1px solid rgba(255,255,255,.08);
}

.km-search-box i{
    color:rgba(255,255,255,.72);
    font-size:16px !important;
    line-height:1 !important;
    width:auto !important;
    margin:0 !important;
}

.km-search-box input{
    width:100%;
    background:transparent;
    border:0;
    outline:0;
    color:white;
    font-size:14px;
}

.km-search-box input::placeholder{
    color:rgba(255,255,255,.58);
}

.km-menu{
    padding:0 10px 24px !important;
}

.km-menu-group{
    margin-bottom:10px;
    border-radius:20px;
    background:rgba(255,255,255,.055);
    border:1px solid rgba(255,255,255,.07);
    overflow:hidden;
}

.km-section-toggle{
    width:100%;
    min-height:66px;
    border:0;
    background:transparent;
    color:white;
    padding:11px 12px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    cursor:pointer;
}

.km-section-left{
    display:flex;
    align-items:center;
    gap:13px;
    text-align:left;
    min-width:0;
    flex:1;
}

.km-section-icon{
    width:44px;
    height:44px;
    min-width:44px;
    max-width:44px;
    border-radius:16px;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    background:rgba(255,255,255,.13);
    overflow:hidden;
    flex:0 0 44px !important;
}

.km-section-icon i{
    width:auto !important;
    height:auto !important;
    min-width:0 !important;
    max-width:none !important;
    margin:0 !important;
    padding:0 !important;
    font-size:20px !important;
    line-height:1 !important;
    text-align:center !important;
    flex:none !important;
}

.km-section-text{
    min-width:0;
    flex:1;
}

.km-section-left strong{
    display:block;
    font-size:14px;
    line-height:1.15;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.km-section-left small{
    display:block;
    font-size:11px;
    line-height:1.1;
    color:rgba(255,255,255,.58);
}

.km-arrow{
    font-size:12px !important;
    transition:transform .22s ease;
    color:rgba(255,255,255,.7);
    margin-left:8px;
    width:auto !important;
    height:auto !important;
    flex:none !important;
}

.km-section-toggle.active .km-arrow{
    transform:rotate(180deg);
}

.km-section{
    display:none;
    padding:0 8px 10px;
}

.km-section.open{
    display:block;
}

.km-menu-link{
    position:relative;
    margin:4px 0;
    padding:8px 12px !important;
    min-height:58px;
    border-radius:14px;
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:14px !important;
    color:rgba(255,255,255,.82) !important;
    text-decoration:none !important;
    transition:.18s ease;
    font-size:14px;
    line-height:1.2;
}

.km-menu-link:hover{
    background:rgba(255,255,255,.10);
    color:white !important;
    transform:translateX(2px);
}

.km-menu-link.active{
    min-height:58px;
    background:rgba(255,255,255,.17);
    color:white !important;
    font-weight:800;
}

.km-link-icon{
    width:46px !important;
    height:46px !important;
    min-width:46px !important;
    max-width:46px !important;
    border-radius:16px !important;
    background:rgba(255,255,255,.09);
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    padding:0 !important;
    margin:0 !important;
    overflow:hidden;
    flex:0 0 46px !important;
}

.km-link-icon i{
    display:block !important;
    width:auto !important;
    height:auto !important;
    min-width:0 !important;
    max-width:none !important;
    margin:0 !important;
    padding:0 !important;
    line-height:1 !important;
    font-size:21px !important;
    text-align:center !important;
    transform:none !important;
    flex:none !important;
}

.km-link-icon i::before,
.km-section-icon i::before{
    display:block !important;
    margin:0 auto !important;
}

.km-link-text{
    min-width:0;
    flex:1;
    white-space:normal;
    line-height:1.2;
}

.km-active-dot{
    width:8px;
    height:8px;
    min-width:8px;
    border-radius:50%;
    background:#ffffff;
    margin-left:auto;
    display:block;
}

.menu-blue .km-section-icon,
.menu-blue .km-menu-link.active .km-link-icon{
    background:linear-gradient(135deg,#3b82f6,#1d4ed8);
}

.menu-purple .km-section-icon,
.menu-purple .km-menu-link.active .km-link-icon{
    background:linear-gradient(135deg,#a855f7,#6d28d9);
}

.menu-orange .km-section-icon,
.menu-orange .km-menu-link.active .km-link-icon{
    background:linear-gradient(135deg,#f59e0b,#ea580c);
}

.menu-green .km-section-icon,
.menu-green .km-menu-link.active .km-link-icon{
    background:linear-gradient(135deg,#10b981,#047857);
}

.menu-gray .km-section-icon,
.menu-gray .km-menu-link.active .km-link-icon{
    background:linear-gradient(135deg,#64748b,#334155);
}

.menu-red .km-section-icon,
.menu-red .km-menu-link.active .km-link-icon{
    background:linear-gradient(135deg,#ef4444,#b91c1c);
}

.km-menu-group.search-hidden{
    display:none !important;
}

.km-menu-link.search-hidden{
    display:none !important;
}

.sidebar .km-menu-link i{
    width:auto !important;
    flex:none !important;
    text-align:center !important;
}

.sidebar .km-menu-link span{
    display:flex !important;
}

.sidebar .km-link-text{
    display:block !important;
}

.sidebar .km-link-icon{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
}

.sidebar .menu-link i{
    flex:none !important;
    width:auto !important;
}

.sidebar .menu-link{
    display:flex !important;
    align-items:center !important;
}

/* BOTÓN FLECHA SOLO COMPUTADORA */

.km-collapse-btn{
    position:absolute;
    top:22px;
    right:-14px;
    width:28px;
    height:28px;
    border:none;
    border-radius:50%;
    background:#ffffff;
    color:#454a9a;
    cursor:pointer;
    box-shadow:0 3px 12px rgba(0,0,0,.25);
    z-index:5000;
    display:flex;
    align-items:center;
    justify-content:center;
}

.km-collapse-btn i{
    font-size:12px;
    transition:.25s ease;
}

body.sidebar-collapsed .km-collapse-btn i{
    transform:rotate(180deg);
}

/* COMPUTADORA */

@media(min-width:992px){

    body.sidebar-collapsed{
        --sidebar-width:80px;
    }

    body.sidebar-collapsed .sidebar{
        width:80px !important;
        min-width:80px !important;
        max-width:80px !important;
        overflow-y:auto !important;
        overflow-x:hidden !important;
    }

    body.sidebar-collapsed .main-content{
        width:calc(100% - 80px);
        flex:1;
    }

    body.sidebar-collapsed .km-brand{
        justify-content:center;
        padding:14px 8px 10px;
        gap:0;
    }

    body.sidebar-collapsed .km-logo-box{
        width:52px;
        height:52px;
        min-width:52px;
        max-width:52px;
        margin:0 auto;
    }

    body.sidebar-collapsed .km-brand-text,
    body.sidebar-collapsed .km-user-info,
    body.sidebar-collapsed .km-search-box,
    body.sidebar-collapsed .km-section-text,
    body.sidebar-collapsed .km-arrow,
    body.sidebar-collapsed .km-link-text,
    body.sidebar-collapsed .km-active-dot{
        display:none !important;
    }

    body.sidebar-collapsed .km-user-card{
        margin:8px 10px 14px;
        padding:9px;
        justify-content:center;
        gap:0;
    }

    body.sidebar-collapsed .km-user-avatar{
        margin:0 auto;
    }

    body.sidebar-collapsed .km-menu{
        padding:0 8px 24px !important;
    }

    body.sidebar-collapsed .km-menu-group{
        border-radius:18px;
        overflow:hidden !important;
        margin-bottom:10px;
    }

    body.sidebar-collapsed .km-section-toggle{
        padding:8px;
        justify-content:center;
        min-height:58px;
    }

    body.sidebar-collapsed .km-section-left{
        justify-content:center;
        gap:0;
        flex:0 0 auto;
    }

    body.sidebar-collapsed .km-section-icon{
        width:48px !important;
        height:48px !important;
        min-width:48px !important;
        max-width:48px !important;
        flex:0 0 48px !important;
    }

    body.sidebar-collapsed .km-section{
        padding:0 6px 8px;
    }

    body.sidebar-collapsed .km-menu-link{
        justify-content:center !important;
        padding:7px !important;
        min-height:54px;
        gap:0 !important;
    }

    body.sidebar-collapsed .km-link-icon{
        width:42px !important;
        height:42px !important;
        min-width:42px !important;
        max-width:42px !important;
        flex:0 0 42px !important;
    }

    body.sidebar-collapsed .km-link-icon i{
        font-size:19px !important;
    }
}

/* CELULAR */

@media(max-width:991px){

    .km-collapse-btn{
        display:none !important;
    }

    .sidebar,
    .km-sidebar,
    #sidebar{
        position:fixed !important;
        top:60px !important;
        left:-280px !important;
        width:280px !important;
        min-width:280px !important;
        max-width:280px !important;
        height:calc(100vh - 60px) !important;
        min-height:calc(100vh - 60px) !important;
        background:#17233b !important;
        z-index:3000 !important;
        box-shadow:12px 0 35px rgba(0,0,0,.35) !important;
        overflow-y:auto !important;
        overflow-x:hidden !important;
        transition:left .25s ease !important;
        display:block !important;
        visibility:visible !important;
        opacity:1 !important;
        transform:none !important;
    }

    .sidebar.activo,
    .km-sidebar.activo,
    #sidebar.activo{
        left:0 !important;
    }

    .mobile-overlay{
        position:fixed !important;
        top:60px !important;
        left:0 !important;
        right:0 !important;
        bottom:0 !important;
        background:rgba(0,0,0,.45) !important;
        z-index:2500 !important;
        display:none !important;
    }

    .mobile-overlay.activo{
        display:block !important;
    }

    .main-content,
    body.sidebar-collapsed .main-content{
        width:100% !important;
        flex:1 1 100% !important;
    }

    body.sidebar-collapsed{
        --sidebar-width:280px !important;
    }

    body.sidebar-collapsed .km-brand{
        justify-content:flex-start !important;
        gap:12px !important;
        padding:14px 14px 10px !important;
    }

    body.sidebar-collapsed .km-brand-text,
    body.sidebar-collapsed .km-user-info,
    body.sidebar-collapsed .km-section-text,
    body.sidebar-collapsed .km-arrow,
    body.sidebar-collapsed .km-link-text,
    body.sidebar-collapsed .km-active-dot{
        display:block !important;
    }

    body.sidebar-collapsed .km-search-box{
        display:flex !important;
    }

    body.sidebar-collapsed .km-user-card{
        justify-content:flex-start !important;
        gap:12px !important;
        margin:8px 14px 14px !important;
        padding:12px !important;
    }

    body.sidebar-collapsed .km-section-toggle{
        justify-content:space-between !important;
        padding:11px 12px !important;
    }

    body.sidebar-collapsed .km-section-left{
        justify-content:flex-start !important;
        gap:13px !important;
        flex:1 !important;
    }

    body.sidebar-collapsed .km-menu-link{
        justify-content:flex-start !important;
        gap:14px !important;
        padding:8px 11px !important;
    }

    body.sidebar-collapsed .km-section-icon{
        width:44px !important;
        height:44px !important;
        min-width:44px !important;
        max-width:44px !important;
        flex:0 0 44px !important;
    }

    body.sidebar-collapsed .km-link-icon{
        width:42px !important;
        height:42px !important;
        min-width:42px !important;
        max-width:42px !important;
        flex:0 0 42px !important;
    }

    .page-content{
        padding:18px;
    }

    body.menu-open{
        overflow:hidden !important;
    }

    .welcome-box{
        padding:20px;
        align-items:flex-start;
    }

    .welcome-icon{
        display:none;
    }
}

@media(max-width:768px){

    .km-brand{
        padding:14px 14px 10px;
    }

    .km-brand h6{
        font-size:17px;
    }

    .km-logo-box{
        width:48px;
        height:48px;
        min-width:48px;
        max-width:48px;
    }

    .km-logo-box .sidebar-logo{
        width:34px !important;
        height:34px !important;
        max-width:34px !important;
        max-height:34px !important;
    }

    .km-menu-link{
        min-height:56px;
        padding:8px 11px !important;
    }

    .km-link-icon{
        width:42px !important;
        height:42px !important;
        min-width:42px !important;
        max-width:42px !important;
        flex:0 0 42px !important;
    }

    .km-link-icon i{
        font-size:19px !important;
    }
}

@media(max-width:576px){

    .navbar-brand{
        font-size:16px;
    }

    .page-content{
        padding:14px;
    }

    .card-dashboard .card-body{
        padding:16px;
    }

    .card-dashboard h2{
        font-size:24px;
    }

    .quick-link{
        min-height:95px;
        font-size:14px;
    }

    .quick-link i{
        font-size:24px;
    }

    .welcome-box h2{
        font-size:22px;
    }
}