* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top left, #1e293b 0%, #020617 45%);
    color: white;
    overflow: hidden;
    user-select: none;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #38bdf8;
    border-radius: 20px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    backdrop-filter: blur(8px);
}

.modal-content {
    width: 400px;
    background: rgba(17, 24, 39, .95);
    padding: 35px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, .05);
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: aparecer .3s ease;
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

@keyframes aparecer {

    from {
        opacity: 0;
        transform: scale(.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }

}

.modal-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-logo i {
    font-size: 34px;
    color: #38bdf8;
}

.modal-logo h1 {
    font-size: 34px;
    font-weight: 700;
    color: #38bdf8;
}

.modal-content p {
    color: #94a3b8;
    margin-bottom: 10px;
    font-size: 14px;
}

.container {
    display: grid;
    grid-template-columns:
        380px 1fr 340px;
    height: 100vh;
}



.sidebar {
    width: 380px;
    background: linear-gradient(180deg, rgba(17, 24, 39, .95), rgba(2, 6, 23, .98));
    border-right: 1px solid rgba(255, 255, 255, .05);
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}

.history-sidebar {
    background: linear-gradient(180deg,
            rgba(17, 24, 39, .95),
            rgba(2, 6, 23, .98));
    border-left: 1px solid rgba(255, 255, 255, .05);
    padding: 20px;
    overflow-y: auto;
    height: 100vh;
}



.perfil {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.perfil-icono {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #38bdf8;
    color: #0f172a;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    font-weight: bold;
    box-shadow: 0 10px 25px rgba(56, 189, 248, .25);
}

.perfil-info h2 {
    font-size: 20px;
    margin-bottom: 4px;
    font-weight: 700;
}

.perfil-info p {
    color: #94a3b8;
    font-size: 14px;
}

.grupo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .05);
    outline: none;
    color: white;
    font-size: 14px;
    transition: .25s;
    white-space: pre-wrap;
}

input:focus,
select:focus,
textarea:focus {
    border: 1px solid #38bdf8;
    background: rgba(15, 23, 42, .95);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, .12);
}

button {
    border: none;
    cursor: pointer;
    transition: .25s;
}

#btnGenerar,
#btnIngresar {
    background: #38bdf8;
    color: #0f172a;
    padding: 15px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#btnGenerar:hover,
#btnIngresar:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(56, 189, 248, .25);
}

.contenido {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.card {
    position: relative;
    overflow: hidden;
    background: rgba(17, 24, 39, .92);
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 24px;
    padding: 20px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(56, 189, 248, .03), transparent);
    pointer-events: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
}

.card-header button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    color: #38bdf8;
    border: 1px solid rgba(255, 255, 255, .05);
}

.card-header button:hover {
    background: #38bdf8;
    color: #0f172a;
    transform: translateY(-2px);
}

textarea {
    height: 250px;
    resize: none;
    line-height: 1.7;
    font-size: 15px;
}

footer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #64748b;
    font-size: 12px;
    text-align: center;
    z-index: 100;
}

.footer-centered {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #64748b;
    font-size: 12px;
    text-align: center;
    z-index: 100;
}

.oculto {
    display: none;
}

#toast {
    position: fixed;
    top: 25px;
    right: 25px;
    background: rgba(17, 24, 39, .95);
    color: white;
    padding: 16px 22px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .05);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: .3s ease;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

#toast.activo {
    opacity: 1;
    transform: translateY(0);
}

#toast i {
    color: #38bdf8;
    font-size: 18px;
}

.quick-box {
    background: rgba(17, 24, 39, .92);
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 24px;
    padding: 20px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}

.quick-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.quick-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
}

.quick-title i {
    color: #38bdf8;
}

#quickSot {
    width: 180px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .05);
    padding: 12px 15px;
    border-radius: 14px;
    color: white;
    font-size: 14px;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.quick-btn {
    background: rgba(255, 255, 255, .04);
    color: white;
    border: 1px solid rgba(255, 255, 255, .05);
    padding: 16px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.quick-btn:hover {
    background: #38bdf8;
    color: #0f172a;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(56, 189, 248, .25);
}

@media(max-width:900px) {

    body {
        overflow: auto;
    }

    .container {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, .05);
    }

    .contenido {
        padding: 20px;
    }

    .modal-content {
        width: 90%;
    }

    .quick-header {
        flex-direction: column;
        align-items: stretch;
    }

    #quickSot {
        width: 100%;
    }

}

#btnLimpiar {
    background: #ef4444;
    color: white;
    padding: 15px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#btnLimpiar:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(239, 68, 68, .25);
}


input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.history-box{ display:flex; flex-direction:column; gap:12px; }

.history-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
}

.history-header i {
    color: #38bdf8;
}

.history-item {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .05);
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.history-text {
    font-size: 13px;
    line-height: 1.5;
    color: #e2e8f0;
    flex: 1;
}

.history-actions {
    display: flex;
    gap: 10px;
}

.history-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #1e293b;
    color: #38bdf8;
    display: flex;
    justify-content: center;
    align-items: center;
}

.history-btn:hover {
    background: #38bdf8;
    color: #0f172a;
}

.history-header{
display:flex;
justify-content:space-between;
align-items:center;
gap:15px;
margin-bottom:20px;
}

.history-title h2{
display:flex;
align-items:center;
gap:10px;
font-size:22px;
}

.history-title i{
color:#38bdf8;
}

.history-tools{
display:flex;
align-items:center;
gap:10px;
}

#buscarHistorial{
width:180px;
padding:12px;
border-radius:12px;
background:rgba(255,255,255,.04);
border:1px solid rgba(255,255,255,.05);
color:white;
}

.history-date{
font-size:12px;
color:#94a3b8;
margin-top:6px;
}

#btnReiniciarGestion {
    background: #8b5cf6;
    color: white;
    padding: 15px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#btnReiniciarGestion:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, .25);
}

/* CONTADOR SOTs */

.contador-sots {
    background: rgba(56, 189, 248, .1);
    border: 1px solid rgba(56, 189, 248, .2);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    color: #cbd5e1;
    font-size: 12px;
}

.contador-sots small {
    display: block;
}

.contador-sots strong {
    color: #38bdf8;
    font-weight: 700;
    font-size: 13px;
}
