/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #e6f7ff 0%, #f0f9ff 100%);
    color: #2c3e50;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 119, 182, 0.1);
    overflow: hidden;
}

/* Шапка */
.header {
    background: linear-gradient(135deg, #0077b6 0%, #0096c7 100%);
    color: white;
    padding: 30px;
    text-align: center;
    border-bottom: 4px solid #00b4d8;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Основной контент */
.content-wrapper {
    display: flex;
    padding: 30px;
    gap: 30px;
}

@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }
}

.main-content {
    flex: 1;
}

/* Карточка статистики */
.stats-card {
    display: flex;
    justify-content: space-between;
    background: linear-gradient(135deg, #caf0f8 0%, #ade8f4 100%);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 119, 182, 0.1);
}

.stat {
    text-align: center;
    flex: 1;
}

.stat-value {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-value.active {
    color: #2ecc71;
}

.stat-value.inactive {
    color: #e74c3c;
}

.stat-label {
    font-size: 1rem;
    color: #555;
    font-weight: 500;
}

/* Панель управления */
.controls-section {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #0077b6 0%, #0096c7 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #005885 0%, #0077a3 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 119, 182, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 20px;
    border: 1px solid #dee2e6;
    min-width: 250px;
}

.search-box i {
    color: #6c757d;
    margin-right: 10px;
}

.search-box input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 1rem;
    color: #495057;
    outline: none;
}

/* Таблица */
.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.ip-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.ip-table thead {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.ip-table th {
    padding: 18px 20px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.ip-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
}

.ip-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Стили для статуса */
.status {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.status.active {
    background-color: rgba(46, 204, 113, 0.15);
    color: #27ae60;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.status.active:hover {
    background-color: rgba(46, 204, 113, 0.25);
}

.status.inactive {
    background-color: rgba(231, 76, 60, 0.15);
    color: #c0392b;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.status.inactive:hover {
    background-color: rgba(231, 76, 60, 0.25);
}

/* Кнопки действий */
.actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.edit-btn {
    background-color: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

.edit-btn:hover {
    background-color: rgba(52, 152, 219, 0.25);
    transform: scale(1.1);
}

.delete-btn {
    background-color: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.delete-btn:hover {
    background-color: rgba(231, 76, 60, 0.25);
    transform: scale(1.1);
}

/* Состояние пустой таблицы */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    display: none;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #adb5bd;
}

.empty-state h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #495057;
}

/* Боковая панель */
.sidebar {
    width: 320px;
}

@media (max-width: 992px) {
    .sidebar {
        width: 100%;
    }
}

.info-card, .help-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.info-card h3, .help-card h3 {
    color: #0077b6;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

.info-card p {
    margin-bottom: 15px;
    line-height: 1.5;
    color: #555;
}

.info-card code {
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #c0392b;
}

.legend {
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

.status-dot.active {
    background-color: #2ecc71;
}

.status-dot.inactive {
    background-color: #e74c3c;
}

.help-card ul {
    padding-left: 20px;
}

.help-card li {
    margin-bottom: 10px;
    line-height: 1.5;
    color: #555;
}

/* Подвал */
.footer {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px 16px 0 0;
}

.modal-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #6c757d;
    cursor: pointer;
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.close-btn:hover {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Форма */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    color: #495057;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #0077b6;
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.1);
}

.form-hint {
    display: block;
    margin-top: 6px;
    color: #6c757d;
    font-size: 0.85rem;
}

/* Переключатель статуса */
.status-toggle {
    margin-top: 10px;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-label input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 60px;
    height: 30px;
    background-color: #e74c3c;
    border-radius: 15px;
    margin-right: 15px;
    transition: background-color 0.3s ease;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle-label input:checked + .toggle-slider {
    background-color: #2ecc71;
}

.toggle-label input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.toggle-text {
    display: flex;
    font-weight: 600;
}

.toggle-on, .toggle-off {
    width: 70px;
}

.toggle-off {
    color: #e74c3c;
}

.toggle-label input:checked ~ .toggle-text .toggle-off {
    display: none;
}

.toggle-on {
    display: none;
    color: #2ecc71;
}

.toggle-label input:checked ~ .toggle-text .toggle-on {
    display: block;
}

/* Модальное окно подтверждения */
.confirm-modal .modal-body {
    text-align: center;
    padding: 40px 30px;
}

.confirm-modal p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #495057;
}

/* Адаптивность */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .stats-card {
        flex-direction: column;
        gap: 20px;
    }
    
    .stat-value {
        font-size: 2.2rem;
    }
    
    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .content-wrapper {
        padding: 20px;
    }
}