/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 95%;
    margin: 0 auto;
    padding: 20px;
}

/* Шапка */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header-image {
    width: 850px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.header h1 {
    color: white;
    font-size: 28px;
    margin-top: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header h2 {
    color: #f0f0f0;
    font-size: 24px;
    margin-top: 5px;
}

/* Навигация */
.nav-menu {
    background: rgba(0,0,0,0.7);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background 0.3s;
    font-size: 18px;
}

.nav-link:hover {
    background: rgba(255,255,255,0.2);
}

.nav-link.active {
    background: #007bff;
}

.nav-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-badge {
    color: #28a745;
    background: rgba(40,167,69,0.2);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
}

.login-btn, .logout-btn {
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    font-weight: bold;
}

.login-btn {
    background: #28a745;
}

.logout-btn {
    background: #dc3545;
}

/* Основной контент */
.main-content {
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    padding: 20px;
    min-height: 500px;
}

/* Главная страница */
.main-page {
    text-align: center;
}

.big-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin: 40px 0;
}

.big-link {
    text-decoration: none;
    color: #333;
    transition: transform 0.3s;
}

.big-link:hover {
    transform: translateY(-5px);
}

.big-link-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 40px 60px;
    border-radius: 15px;
    color: white;
    text-align: center;
}

.big-link-number {
    font-size: 32px;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

.big-link-desc {
    font-size: 18px;
}

/* Формы */
.date-form {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.form-inline {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: bold;
    color: #555;
}

.form-control, .form-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.quick-periods {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 5px 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.btn-small:hover {
    background: #5a6268;
}

.btn-primary {
    padding: 8px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

/* Форма редактирования */
.edit-form {
    background: rgba(0,0,0,0.8);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.edit-form h3 {
    color: white;
    margin-bottom: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

/* Таблицы */
.table-wrapper {
    overflow-x: auto;
}

.data-table, .edit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: white;
}

.data-table th, .edit-table th {
    background: #4472C4;
    color: white;
    padding: 10px;
    border: 1px solid #ddd;
}

.data-table td, .edit-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: center;
}

.data-table tr:nth-child(even) {
    background: #f9f9f9;
}

.object-name {
    background: #E8F4FD;
    font-weight: bold;
    text-align: left;
}

.z-value {
    color: #28a745;
    font-weight: bold;
}

.power-cell {
    background: #D6E4F0;
}

.result-cell {
    background: #FFF3E0;
    font-weight: bold;
}

.edit-table td {
    text-align: left;
}

.edit-table input {
    width: 100%;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 0;
    width: 90%;
    max-width: 400px;
    border-radius: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-content form {
    padding: 20px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Информационные секции */
.info-section {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border-left: 4px solid #28a745;
}

.info-section p {
    margin: 5px 0;
}

.page-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4472C4;
}

.page-header h2 {
    color: #333;
    margin-bottom: 5px;
}

.page-header p {
    color: #666;
}

.table-caption {
    text-align: center;
    margin: 10px 0;
    font-style: italic;
    color: #555;
}

/* Подвал */
.footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: white;
    background: rgba(0,0,0,0.5);
    border-radius: 10px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .header-image {
        width: 100%;
        height: auto;
    }
    
    .header h1, .header h2 {
        font-size: 18px;
    }
    
    .nav-link {
        font-size: 14px;
        padding: 5px 10px;
    }
    
    .big-link-content {
        padding: 20px 30px;
    }
    
    .big-link-number {
        font-size: 20px;
    }
    
    .data-table {
        font-size: 10px;
    }
    
    .data-table th, .data-table td {
        padding: 4px;
    }
}