/* header.css */
* { box-sizing: border-box; }

html { 
    overflow-y: scroll; 
    overflow-x: hidden; 
}

body { 
    background-color: #f1f5f9; 
    font-family: 'Inter', sans-serif; 
    margin: 0; 
    padding: 0; 
    width: 100%;
}

/* --- НАВИГАЦИЯ (NAVBAR) --- */
.navbar { 
    background-color: #2c3e50; 
    display: flex; 
    justify-content: center; 
    position: fixed; 
    top: 0; 
    left: 0;
    right: 0; 
    z-index: 1000; 
    height: 50px; 
    align-items: center; 
}

.nav-links a { 
    color: white; 
    padding: 15px 20px; 
    text-decoration: none; 
    text-transform: uppercase; 
    font-size: 13px; 
    font-weight: bold; 
    display: inline-block;
    height: 50px;
    line-height: 20px;
    border-bottom: 3px solid transparent;
    transition: 0.2s;
}

.nav-links a:hover {
    background-color: #34495e;
}

.nav-links a.active { 
    border-bottom: 3px solid #3498db; 
    background-color: #1a252f; 
}

.user-panel {
    position: absolute;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: #3498db;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 13px;
    white-space: nowrap;
}

.logout-top {
    color: #fb8c00;
    text-decoration: none;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid #fb8c00;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    transition: 0.3s;
}

.logout-top:hover {
    background-color: #fb8c00;
    color: white !important;
}

.calc-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.calc-actions button {
    cursor: pointer;
    border: 1px solid #ccc;
    background: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 20px;
    transition: 0.2s;
}

.calc-actions button:hover {
    background: #f0f4f8;
    border-color: #3498db;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.history-card {
    background: white;
    width: 450px;
    max-width: 95%;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    overflow: hidden;
}

.history-header {
    background: #2c3e50;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 14px;
}

.history-body {
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: #f9f9f9;
}

.btn-load {
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.btn-load:hover {
    background: #2980b9;
}

.burger { 
    display: none; 
    cursor: pointer; 
    flex-direction: column; 
    gap: 4px; 
    padding: 10px; 
    position: absolute; 
    left: 15px; 
}

.burger div { width: 22px; height: 3px; background-color: white; }

@media (max-width: 650px) {
    .nav-links { display: none; }

    .nav-links.show {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 50px;
        left: 0;
        width: 100%;
        background: #2c3e50;
        z-index: 999;
    }
    .nav-links.show a {
        border-bottom: 1px solid #34495e;
        padding: 12px 20px;
        height: auto; /* убираем фиксированную высоту для вертикального меню */
    }

    .burger { display: flex; }
    .user-name { display: none; }
    .user-panel { right: 10px; }
}

.main-container { 
    max-width: 1800px; 
    margin: 30px auto 10px; 
    padding: 0 20px; 
    width: 100%; 
}