/* --- HISTORY SLIDE-OUT PANEL --- */
#historyPanel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 350px;
    max-width: 85%;
    background: #ffffff;
    z-index: 100002;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
}

#historyPanel.open { transform: translateX(0); }

.history-header {
    padding: 25px;
    background: #ffffff;
    border-bottom: 2px solid #ef4444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header b {
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    font-weight: 800;
}

.history-close-btn {
    width: 32px;
    height: 32px;
    background: #f8fafc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #94a3b8;
}

#historyList { flex: 1; overflow-y: auto; padding: 20px; }

.history-item {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
}

.history-name { display: block; font-weight: 800; color: #0f172a; font-size: 14px; text-transform: capitalize; }
.history-date { display: block; font-size: 11px; color: #94a3b8; font-weight: 600; }

.history-actions { display: flex; gap: 8px; }
.btn-history-action { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 12px; border: none; cursor: pointer; }
.btn-recalc { background: #f8fafc; color: #6366f1; }
.btn-del-history { background: #fef2f2; color: #ef4444; }