/* ===== RESET ===== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial,sans-serif;
}

/* ===== BODY ===== */

body{
    display:flex;
    min-height:100vh;
    background:#f4f6fb;
    color:#333;
}

/* ===== SIDEBAR ===== */

.sidebar{
    width:250px;
    background:#4f46e5;
    color:white;
    padding:25px;
    display:flex;
    flex-direction:column;
    gap:15px;
    position:fixed;
    left:0;
    top:0;
    height:100vh;
}

.sidebar h2{
    margin-bottom:20px;
    font-size:2rem;
}

.sidebar a{
    text-decoration:none;
}

.sidebar button{
    width:100%;
    border:none;
    padding:14px;
    border-radius:12px;
    background:rgba(255,255,255,0.15);
    color:white;
    cursor:pointer;
    transition:0.3s;
    text-align:left;
    font-size:1rem;
}

.sidebar button:hover{
    background:rgba(255,255,255,0.25);
}

/* ===== MAIN ===== */

.main{
    margin-left:270px;
    width:calc(100% - 270px);
    padding:25px;
}

/* ===== TOPBAR ===== */

.topbar{
    margin-bottom:25px;
}

.topbar h1{
    font-size:2rem;
}

/* ===== MONTH NAV ===== */

.month-nav{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
    gap:15px;
}

.month-nav a{
    text-decoration:none;
    background:#4f46e5;
    color:white;
    padding:6px 10px;
    border-radius:8px;
    transition:0.3s;
    font-size:0.8rem;
}

.month-nav a:hover{
    background:#4338ca;
}

.month-nav h2{
    font-size:1.3rem;
    text-transform:capitalize;
}

/* ===== CALENDARIO ===== */

.month-calendar{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    gap:10px;
}

/* ===== HEADER ===== */

.calendar-header{
    background:#4f46e5;
    color:white;
    padding:6px;
    text-align:center;
    border-radius:6px;
    font-weight:bold;
    font-size:0.75rem;
}

/* ===== EMPTY ===== */

.empty-day{
    min-height:150px;
}

/* ===== DAY ===== */

.day{
    background:white;
    min-height:95px;
    border-radius:8px;
    padding:4px;
    box-shadow:0 2px 5px rgba(0,0,0,0.06);
    overflow:hidden;
    display:flex;
    flex-direction:column;
    gap:2px;
}

/* ===== DAY NUMBER ===== */

.day-number{
    font-size:0.8rem;
    font-weight:bold;
    margin-bottom:2px;
}

/* ===== EVENT ===== */

.event{
    padding:3px 5px;
    border-radius:5px;
    color:white;
    font-size:0.6rem;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    margin-bottom:2px;
}

.event:hover{
    transform:scale(1.02);
}

/* ===== ACTIONS ===== */

.event-actions{
    display:none;
}

.event-actions a{
    color:white;
    text-decoration:none;
    font-size:0.9rem;
}

/* ===== FORM ===== */

.modal-content{
    background:white;
    width:100%;
    max-width:600px;
    padding:25px;
    border-radius:20px;
    box-shadow:0 10px 25px rgba(0,0,0,0.1);
}

/* ===== INPUTS ===== */

.modal-content input,
.modal-content textarea,
.modal-content select{
    width:100%;
    padding:12px;
    margin-bottom:15px;
    border:1px solid #ccc;
    border-radius:10px;
    font-size:1rem;
}

/* ===== TEXTAREA ===== */

.modal-content textarea{
    resize:none;
    height:100px;
}

/* ===== DAYS ===== */

.dias{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px;
    margin-bottom:20px;
}

.dias label{
    display:flex;
    align-items:center;
    gap:8px;
}

/* ===== BUTTON ===== */

.save-btn{
    width:100%;
    border:none;
    padding:14px;
    background:#4f46e5;
    color:white;
    border-radius:12px;
    cursor:pointer;
    transition:0.3s;
    font-size:1rem;
}

.save-btn:hover{
    background:#4338ca;
}

/* ===== LOGIN ===== */

.login-container{
    background:white;
    padding:35px;
    width:90%;
    max-width:400px;
    border-radius:20px;
    box-shadow:0 10px 25px rgba(0,0,0,0.1);
    margin:auto;
    margin-top:80px;
}

.login-container h1{
    text-align:center;
    margin-bottom:25px;
    color:#4f46e5;
}

.login-container input{
    width:100%;
    padding:14px;
    margin-bottom:15px;
    border:1px solid #ccc;
    border-radius:12px;
}

.login-container button{
    width:100%;
    border:none;
    padding:14px;
    border-radius:12px;
    background:#4f46e5;
    color:white;
    cursor:pointer;
    font-size:1rem;
}

.login-container button:hover{
    background:#4338ca;
}

/* ===== ERROR ===== */

.error{
    background:#fee2e2;
    color:#b91c1c;
    padding:10px;
    border-radius:10px;
    margin-bottom:15px;
}

/* ===== LINK ===== */

.link{
    text-align:center;
    margin-top:15px;
}

.link a{
    color:#4f46e5;
    text-decoration:none;
}

/* ===== WEEK VIEW ===== */

.week-table{
    display:flex;
    flex-direction:column;
    gap:5px;
}

.week-header,
.week-row{
    display:grid;
    grid-template-columns:100px repeat(7,1fr);
    gap:5px;
}

.week-header div{
    background:#4f46e5;
    color:white;
    padding:10px;
    border-radius:10px;
    text-align:center;
    font-weight:bold;
}

.week-cell,
.hour{
    background:white;
    min-height:70px;
    border-radius:10px;
    padding:5px;
}

.hour{
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;
}
.week-event{
    position:absolute;
    top:0;
    left:2px;
    right:2px;
    color:white;
    padding:5px;
    border-radius:8px;
    overflow:hidden;
    font-size:0.7rem;
    z-index:10;
    box-shadow:0 3px 8px rgba(0,0,0,0.15);
    cursor:pointer;
    transition:0.2s;
}

.week-event:hover{
    transform:scale(1.02);
    filter:brightness(1.05);
}

/* ===== RESPONSIVE ===== */

@media(max-width:1100px){

    .month-calendar{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    gap:4px;
    }

}

@media(max-width:800px){

    body{
        flex-direction:column;
    }

    .sidebar{
        width:100%;
        height:auto;
        position:relative;
    }

    .main{
        margin-left:270px;
        width:calc(100% - 270px);
        padding:10px;
    }

    .month-calendar{
        grid-template-columns:1fr;
    }

    .week-header,
    .week-row{
        grid-template-columns:80px repeat(7,200px);
        overflow-x:auto;
    }

}
/* ===== WEEK CALENDAR ===== */

.week-calendar{
    display:flex;
    flex-direction:column;
    gap:2px;
    overflow-x:auto;
}

.week-header-row,
.week-row{
    display:grid;
    grid-template-columns:60px repeat(7,1fr);
    gap:0;
}

.week-day,
.hour-column{
    background:#4f46e5;
    color:white;
    padding:8px;
    border-radius:8px;
    text-align:center;
    font-weight:bold;
    font-size:0.8rem;
}

.hour-slot{
    background:white;
    border-radius:6px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;
    min-height:45px;
    font-size:0.75rem;
}

.week-cell{
    background:white;
    min-height:45px;
    position:relative;
    border:1px solid #e5e7eb;
    padding:0;
}

.week-event{
    position:absolute;
    top:0;
    left:2px;
    right:2px;
    color:white;
    padding:5px;
    border-radius:8px;
    overflow:hidden;
    font-size:0.7rem;
    z-index:10;
    box-shadow:0 3px 8px rgba(0,0,0,0.15);
    cursor:grab;
    transition:0.2s;
    user-select:none;
}

.week-event:hover{
    transform:scale(1.02);
    filter:brightness(1.05);
}

.week-event:active{
    cursor:grabbing;
}

.event-time{
    font-size:0.55rem;
    margin-top:1px;
}

.main{
    margin-left:270px;
    width:calc(100% - 270px);
    padding:15px;
}

/* ===== RESPONSIVE ===== */

@media(max-width:1000px){

    .week-header-row,
    .week-row{
        grid-template-columns:80px repeat(7,220px);
    }

    .week-calendar{
        overflow-x:scroll;
    }

}
/* ===== EVENTOS EXTRA ===== */

.more-events{
    font-size:0.6rem;
    color:#4f46e5;
    font-weight:bold;
    margin-top:2px;
    cursor:pointer;
}

/* ===== TOOLTIP ===== */

.event{
    position:relative;
}

.tooltip{
    position:absolute;
    top:105%;
    left:0;
    width:220px;
    background:white;
    color:#333;
    border-radius:10px;
    padding:12px;
    box-shadow:0 10px 25px rgba(0,0,0,0.15);
    z-index:999;
    display:none;
    font-size:0.75rem;
}

.tooltip h4{
    margin-bottom:8px;
    color:#4f46e5;
}

.tooltip p{
    margin-bottom:5px;
}

.event:hover .tooltip{
    display:block;
}

/* ===== MINI CALENDARIO ===== */

.mini-calendar{
    background:white;
    border-radius:15px;
    padding:15px;
    margin-top:20px;
    box-shadow:0 5px 10px rgba(0,0,0,0.08);
}

.mini-grid{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    gap:3px;
    margin-top:10px;
}

.mini-day{
    text-align:center;
    padding:6px;
    border-radius:5px;
    font-size:0.7rem;
    background:#f3f4f6;
}

.today{
    background:#4f46e5;
    color:white;
}

/* ===== BUSCADOR ===== */

.search-box{
    margin-bottom:15px;
}

.search-box input{
    width:100%;
    padding:10px;
    border-radius:10px;
    border:1px solid #d1d5db;
}

/* ===== ESTADISTICAS ===== */

.stats{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
    margin-bottom:20px;
}

.stat-card{
    background:white;
    padding:15px;
    border-radius:12px;
    text-align:center;
    box-shadow:0 5px 10px rgba(0,0,0,0.06);
}

.stat-card h3{
    font-size:1.5rem;
    color:#4f46e5;
}

.stat-card p{
    font-size:0.8rem;
    margin-top:5px;
}

/* ===== RESPONSIVE ===== */

@media(max-width:900px){

    .stats{
        grid-template-columns:1fr;
    }

}
/* ===== BOTON MODAL ===== */

.open-modal-btn{
    margin-top:4px;
    width:100%;
    border:none;
    padding:3px;
    border-radius:5px;
    background:rgba(255,255,255,0.2);
    color:white;
    cursor:pointer;
    font-size:0.6rem;
}

/* ===== MODAL ===== */

.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.5);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:9999;
}

.modal-box{
    background:white;
    width:90%;
    max-width:400px;
    border-radius:20px;
    padding:25px;
    position:relative;
    animation:modalShow 0.2s ease;
}

@keyframes modalShow{

from{
    transform:scale(0.9);
    opacity:0;
}

to{
    transform:scale(1);
    opacity:1;
}

}

.close-modal{
    position:absolute;
    right:15px;
    top:10px;
    font-size:1.5rem;
    cursor:pointer;
}

.modal-box h2{
    margin-bottom:15px;
    color:#4f46e5;
}

.modal-box p{
    margin-bottom:10px;
}

.modal-actions{
    margin-top:20px;
    display:flex;
    gap:10px;
}

.modal-actions a{
    flex:1;
    text-align:center;
    text-decoration:none;
    padding:10px;
    border-radius:10px;
    color:white;
}

.modal-actions a:first-child{
    background:#4f46e5;
}

.modal-actions a:last-child{
    background:#ef4444;
}
/* ===== DRAG ===== */

.dragging{
    opacity:0.5;
}

.drag-over{
    background:#e0e7ff;
}
/* ===== MODAL ACTIVIDAD ===== */

.activity-modal{
    max-width:650px;
}

/* ===== DOBLE INPUT ===== */

.double-input{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:15px;
    margin-bottom:15px;
}

/* ===== LABEL ===== */

.activity-modal label{
    display:block;
    margin-bottom:5px;
    font-size:0.85rem;
    font-weight:bold;
}

/* ===== SELECT ===== */

.activity-modal select{
    width:100%;
    padding:12px;
    border-radius:10px;
    border:1px solid #d1d5db;
    background:white;
}

/* ===== REPETICION ===== */

.repeat-label{
    margin-bottom:10px;
}

/* ===== GRID ===== */

.repeat-grid{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    gap:10px;
    margin-bottom:20px;
}

/* ===== DIA ===== */

.repeat-day{
    position:relative;
}

.repeat-day input{
    display:none;
}

.repeat-day span{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:12px;
    border-radius:12px;
    background:#f3f4f6;
    cursor:pointer;
    transition:0.2s;
    font-size:0.85rem;
    font-weight:bold;
}

/* ===== CHECKED ===== */

.repeat-day input:checked + span{
    background:#4f46e5;
    color:white;
    transform:scale(1.05);
}

/* ===== HOVER ===== */

.repeat-day span:hover{
    background:#e0e7ff;
}

/* ===== RESPONSIVE ===== */

@media(max-width:700px){

    .repeat-grid{
        grid-template-columns:repeat(4,1fr);
    }

    .double-input{
        grid-template-columns:1fr;
    }

}
/* ===== TOPBAR ===== */

.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

.topbar-right{
    display:flex;
    align-items:center;
    gap:15px;
}

/* ===== SETTINGS ===== */

.settings-btn{
    width:45px;
    height:45px;
    border-radius:50%;
    background:#4f46e5;
    color:white;
    text-decoration:none;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:1.2rem;
    transition:0.2s;
}

.settings-btn:hover{
    transform:rotate(90deg);
}

/* ===== PROFILE ===== */

.profile-image{
    width:50px;
    height:50px;
    border-radius:50%;
    object-fit:cover;
    border:3px solid white;
    box-shadow:0 5px 10px rgba(0,0,0,0.1);
}

.config-profile-image{
    width:120px;
    height:120px;
    border-radius:50%;
    object-fit:cover;
    margin:auto;
    display:block;
    margin-bottom:20px;
    box-shadow:0 5px 15px rgba(0,0,0,0.1);
}

/* ===== FILE ===== */

.profile-upload{
    margin-bottom:20px;
}

.profile-upload label{
    display:block;
    margin-bottom:8px;
    font-weight:bold;
}

input[type="file"]{
    width:100%;
    padding:10px;
    border-radius:10px;
    background:#f3f4f6;
}