 * { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', Arial, sans-serif; 
}

body { 
    background: #f1f5fa; 
    padding: 12px; 
}

.container { 
    max-width: 1400px; 
    margin: auto; 
    background: white; 
    padding: 20px; 
    border-radius: 20px; 
    box-shadow: 0 20px 50px rgba(0,0,0,.08); 
}

.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
    flex-wrap: wrap;
    gap: 10px;
}

.header h1 { 
    color: #0b2b5e; 
    font-size: clamp(18px, 4vw, 28px);
}

.header button { 
    border: 0;
    background: #0b2b5e;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: clamp(12px, 2vw, 14px);
    white-space: nowrap;
}

.header button:hover {
    background: #1a3f72;
}

.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; 
    margin-bottom: 25px; 
}

.stat-card { 
    background: #f7faff; 
    padding: 15px 10px; 
    border-radius: 16px; 
    text-align: center; 
}

.stat-card i { 
    font-size: clamp(20px, 4vw, 30px); 
    color: #0b2b5e; 
}

.stat-card strong { 
    display: block; 
    font-size: clamp(22px, 5vw, 28px); 
    margin: 6px 0; 
}

.stat-card p { 
    font-size: clamp(11px, 1.8vw, 14px); 
    color: #63778d; 
}

.stat-card .sub-text {
    font-size: clamp(9px, 1.2vw, 11px);
    color: #8a9bb0;
    margin-top: 2px;
}

.charts-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 20px; 
    margin-bottom: 25px; 
}

.chart-box { 
    background: #f7faff; 
    padding: 15px; 
    border-radius: 16px; 
    overflow: hidden;
}

.chart-box h3 { 
    margin-bottom: 12px; 
    color: #0b2b5e; 
    font-size: clamp(14px, 2.5vw, 18px);
    text-align: center;
}

.chart-box canvas { 
    max-height: 200px; 
    max-width: 100%;
    height: auto !important;
    width: 100% !important;
}

.top-ads { 
    background: #f7faff; 
    padding: 15px; 
    border-radius: 16px; 
}

.top-ads h3 { 
    margin-bottom: 12px; 
    color: #0b2b5e; 
    font-size: clamp(14px, 2.5vw, 18px);
}

.ad-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 10px 0; 
    border-bottom: 1px solid #e5edf6; 
    font-size: clamp(12px, 1.8vw, 14px);
    flex-wrap: wrap;
    gap: 5px;
}

.ad-item:last-child { 
    border-bottom: 0; 
}

.ad-item .title {
    font-weight: 500;
    flex: 1;
    min-width: 100px;
}

.ad-item .clicks-badge {
    background: #0b2b5e;
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: clamp(11px, 1.5vw, 13px);
    white-space: nowrap;
}

.ad-item .unique-badge {
    background: #168344;
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: clamp(11px, 1.5vw, 13px);
    white-space: nowrap;
}

.error-box { 
    text-align: center; 
    padding: 40px 20px; 
    color: #d93434; 
}

.error-box i { 
    font-size: 48px; 
}

.error-box p { 
    margin-top: 15px; 
    font-size: clamp(16px, 3vw, 20px); 
}

.error-box button { 
    margin-top: 20px;
    padding: 10px 30px;
    border: 0;
    border-radius: 20px;
    background: #0b2b5e;
    color: white;
    cursor: pointer;
    font-size: clamp(14px, 2vw, 16px);
}

.no-data {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: clamp(14px, 2vw, 16px);
}

/* ===== АДАПТИВ ===== */
@media (min-width: 600px) {
    .stats-grid { 
        grid-template-columns: repeat(5, 1fr); 
        gap: 20px; 
    }
    
    .charts-grid { 
        grid-template-columns: 1fr 1fr; 
        gap: 30px; 
    }
    
    .chart-box { 
        padding: 25px; 
    }
    
    .chart-box canvas { 
        max-height: 250px; 
    }
    
    body { 
        padding: 20px; 
    }
    
    .container { 
        padding: 35px; 
        border-radius: 24px; 
    }
}

@media (max-width: 500px) {
    .stats-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
}

@media (max-width: 400px) {
    body { 
        padding: 6px; 
    }
    
    .container { 
        padding: 12px; 
        border-radius: 14px; 
    }
    
    .stats-grid { 
        gap: 8px; 
    }
    
    .stat-card { 
        padding: 12px 8px; 
        border-radius: 12px; 
    }
    
    .chart-box { 
        padding: 10px; 
        border-radius: 12px; 
    }
    
    .header h1 { 
        font-size: 16px; 
    }
    
    .header button { 
        padding: 6px 14px; 
        font-size: 11px; 
    }
}

.feedback-admin-section {
    background: #f7faff;
    padding: 20px;
    border-radius: 16px;
    margin-top: 25px;
}

.feedback-admin-section h3 {
    color: #0b2b5e;
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== ФИЛЬТРЫ ===== */
.feedback-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.feedback-filters .filter-btn {
    padding: 6px 16px;
    border: 2px solid #e5edf6;
    border-radius: 20px;
    background: white;
    font-size: 13px;
    font-weight: 500;
    color: #63778d;
    cursor: pointer;
    transition: all 0.25s ease;
}

.feedback-filters .filter-btn:hover {
    border-color: #b8c8dd;
}

.feedback-filters .filter-btn.active {
    border-color: #0b2b5e;
    background: #edf3fa;
    color: #0b2b5e;
}

/* ===== СПИСОК ОТЗЫВОВ ===== */
.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 4px;
}

.feedback-list::-webkit-scrollbar {
    width: 6px;
}

.feedback-list::-webkit-scrollbar-track {
    background: #e5edf6;
    border-radius: 3px;
}

.feedback-list::-webkit-scrollbar-thumb {
    background: #b8c8dd;
    border-radius: 3px;
}

.feedback-list::-webkit-scrollbar-thumb:hover {
    background: #8a9bb0;
}

/* ===== ОДИН ОТЗЫВ ===== */
.feedback-item {
    background: white;
    border-radius: 14px;
    padding: 16px 20px;
    border: 1px solid #e5edf6;
    transition: all 0.3s ease;
}

.feedback-item:hover {
    border-color: #b8c8dd;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.feedback-item.unread {
    border-left: 4px solid #0b2b5e;
    background: #f8faff;
}

.feedback-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.feedback-category {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 12px;
    text-transform: capitalize;
}

.feedback-category.suggestion {
    background: #e8f0fa;
    color: #0b2b5e;
}

.feedback-category.complaint {
    background: #fde8e8;
    color: #d93434;
}

.feedback-category.review {
    background: #fef6e0;
    color: #b8860b;
}

.feedback-category.bug {
    background: #f0e8f8;
    color: #6f42c1;
}

.feedback-date {
    font-size: 12px;
    color: #8a9bb0;
}

.feedback-item-user {
    font-size: 13px;
    color: #63778d;
    margin-bottom: 6px;
}

.feedback-item-user i {
    margin-right: 4px;
}

.feedback-item-message {
    font-size: 14px;
    color: #14253d;
    line-height: 1.5;
    padding: 6px 0 4px 0;
    word-wrap: break-word;
}

.feedback-item-message::before {
    content: '"';
    color: #b8c8dd;
}

.feedback-item-message::after {
    content: '"';
    color: #b8c8dd;
}

/* ===== ОТВЕТ ===== */
.feedback-item-answer {
    margin-top: 10px;
    padding: 10px 14px;
    background: #edf3fa;
    border-radius: 10px;
    border-left: 3px solid #168344;
    font-size: 14px;
    color: #14253d;
}

.feedback-item-answer strong {
    color: #168344;
}

/* ===== ФОРМА ОТВЕТА ===== */
.feedback-item-answer-form {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.feedback-item-answer-form input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e5edf6;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: 0.3s;
    font-family: inherit;
}

.feedback-item-answer-form input:focus {
    border-color: #0b2b5e;
    box-shadow: 0 0 0 4px rgba(11, 43, 94, 0.08);
}

.feedback-item-answer-form input::placeholder {
    color: #a8b8cc;
}

.feedback-item-answer-form button {
    padding: 10px 20px;
    border: 0;
    border-radius: 12px;
    background: #0b2b5e;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
    font-size: 14px;
}

.feedback-item-answer-form button:hover {
    background: #1a3f72;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(11, 43, 94, 0.3);
}

.feedback-item-answer-form button:active {
    transform: translateY(0);
}

/* ===== НЕТ ДАННЫХ ===== */
.feedback-list .no-data {
    text-align: center;
    padding: 40px 20px;
    color: #8a9bb0;
    font-size: 15px;
}

/* ============================================================
   АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ
   ============================================================ */

@media (max-width: 768px) {
    .feedback-admin-section {
        padding: 14px;
        border-radius: 12px;
    }
    
    .feedback-filters {
        gap: 6px;
    }
    
    .feedback-filters .filter-btn {
        font-size: 12px;
        padding: 4px 12px;
    }
    
    .feedback-item {
        padding: 14px 16px;
    }
    
    .feedback-item-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .feedback-item-answer-form {
        flex-direction: column;
    }
    
    .feedback-item-answer-form button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 400px) {
    .feedback-filters .filter-btn {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    .feedback-item {
        padding: 12px 14px;
    }
    
    .feedback-item-message {
        font-size: 13px;
    }
}
/* ===== МАЛЕНЬКИЕ ТОГЛЫ ДЛЯ СОЦСЕТЕЙ ===== */
.settings-toggle-row {
    margin-bottom: 8px;
}

.toggle-label.small .toggle-slider {
    width: 36px;
    height: 20px;
}

.toggle-label.small .toggle-slider::after {
    width: 16px;
    height: 16px;
}

.toggle-label.small input:checked + .toggle-slider::after {
    left: 18px;
}

.toggle-label.small .toggle-text {
    font-size: 13px;
}
/* ============================================================
   НАСТРОЙКИ САЙТА
   ============================================================ */

.settings-section {
    background: #f7faff;
    padding: 20px;
    border-radius: 16px;
    margin-top: 25px;
}

.settings-section h3 {
    color: #0b2b5e;
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.settings-group h4 {
    color: #0b2b5e;
    font-size: 15px;
    margin-bottom: 12px;
    border-bottom: 2px solid #e5edf6;
    padding-bottom: 8px;
}

.settings-field {
    margin-bottom: 12px;
}

.settings-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.settings-field input {
    width: 100%;
    padding: 8px 14px;
    border: 2px solid #e0e4ea;
    border-radius: 10px;
    font-size: 14px;
    transition: 0.25s;
    background: #fafbfc;
}

.settings-field input:focus {
    outline: none;
    border-color: #0b2b5e;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(11, 43, 94, 0.08);
}

/* ===== ТОГЛЫ ===== */
.settings-toggle {
    margin-bottom: 12px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #14253d;
    user-select: none;
}

.toggle-label input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #c8d0da;
    border-radius: 12px;
    transition: 0.3s;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.toggle-label input:checked + .toggle-slider {
    background: #0b2b5e;
}

.toggle-label input:checked + .toggle-slider::after {
    left: 22px;
}

.toggle-label input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-text {
    font-weight: 500;
}

/* ===== ИНФО ===== */
.settings-info {
    margin-top: 16px;
    padding: 12px 16px;
    background: #eef3f9;
    border-radius: 10px;
    font-size: 13px;
    color: #63778d;
}

.settings-info small {
    display: block;
    margin: 2px 0;
}

/* ===== КНОПКА СОХРАНЕНИЯ ===== */
.settings-save-btn {
    align-self: flex-start;
    padding: 10px 30px;
    border: 0;
    border-radius: 12px;
    background: #0b2b5e;
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-save-btn:hover {
    background: #1a3f72;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11, 43, 94, 0.3);
}

.settings-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.settings-save-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== СООБЩЕНИЕ ===== */
.settings-message {
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 500;
    display: none;
}

.settings-message.success {
    display: block;
    background: #e8f5ee;
    color: #168344;
}

.settings-message.error {
    display: block;
    background: #fde8e8;
    color: #d93434;
}

/* ============================================================
   АДАПТАЦИЯ
   ============================================================ */

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .settings-section {
        padding: 14px;
    }
    
    .settings-save-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   УПРАВЛЕНИЕ КАМЕРАМИ
   ============================================================ */

.cameras-section {
    background: #f7faff;
    padding: 20px;
    border-radius: 16px;
    margin-top: 25px;
}

.cameras-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.cameras-header h3 {
    color: #0b2b5e;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-add-camera {
    padding: 8px 20px;
    border: 0;
    border-radius: 30px;
    background: #0b2b5e;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-add-camera:hover {
    background: #1a3f72;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11, 43, 94, 0.3);
}

/* ===== СПИСОК КАМЕР ===== */
.cameras-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.camera-card {
    background: white;
    border-radius: 14px;
    padding: 18px 20px;
    border: 1px solid #e5edf6;
    transition: 0.3s;
    position: relative;
}

.camera-card:hover {
    border-color: #b8c8dd;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.camera-card .camera-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.camera-card .camera-card-name {
    font-size: 16px;
    font-weight: 600;
    color: #0b2b5e;
}

.camera-card .camera-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 12px;
    border-radius: 12px;
}

.camera-card .camera-card-status.active {
    background: #e8f5ee;
    color: #168344;
}

.camera-card .camera-card-status.inactive {
    background: #fde8e8;
    color: #d93434;
}

.camera-card .camera-card-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.camera-card .camera-card-status.active .dot {
    background: #168344;
}

.camera-card .camera-card-status.inactive .dot {
    background: #d93434;
}

.camera-card .camera-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    font-size: 13px;
    color: #63778d;
    margin: 6px 0 12px 0;
}

.camera-card .camera-card-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.camera-card .camera-card-details i {
    width: 16px;
    color: #0b2b5e;
    font-size: 12px;
}

.camera-card .camera-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #eef2f6;
}

.camera-card .camera-card-actions button {
    padding: 5px 14px;
    border: 0;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.camera-card .camera-card-actions .btn-edit {
    background: #edf3fa;
    color: #0b2b5e;
}

.camera-card .camera-card-actions .btn-edit:hover {
    background: #dce6f2;
}

.camera-card .camera-card-actions .btn-delete {
    background: #fde8e8;
    color: #d93434;
}

.camera-card .camera-card-actions .btn-delete:hover {
    background: #fcd5d5;
}

.camera-card .camera-card-actions .btn-check {
    background: #fef6e0;
    color: #b8860b;
}

.camera-card .camera-card-actions .btn-check:hover {
    background: #fdf0cc;
}

.camera-card .camera-card-actions .btn-check.ok {
    background: #e8f5ee;
    color: #168344;
}

.camera-card .camera-card-actions .btn-check.timeout {
    background: #fde8e8;
    color: #d93434;
}

/* ===== ПРЕДПРОСМОТР КАРТЫ ===== */
.camera-preview-section {
    margin-top: 16px;
}

.camera-preview-section label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    display: block;
    margin-bottom: 4px;
}

.camera-hint {
    font-size: 11px;
    color: #8a9bb0;
    margin-top: 4px;
    display: block;
}

/* ===== МОДАЛЬНОЕ ОКНО КАМЕРЫ ===== */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.camera-modal.active {
    display: flex;
}

.camera-modal-content {
    background: white;
    border-radius: 24px;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: slideUpModal 0.3s ease;
}

.camera-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eef2f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.camera-modal-header h3 {
    font-size: 18px;
    color: #0b2b5e;
    display: flex;
    align-items: center;
    gap: 10px;
}

.camera-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0 8px;
    border-radius: 8px;
    transition: 0.2s;
    line-height: 1;
}

.camera-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.camera-modal-body {
    padding: 24px;
}

.camera-modal-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #eef2f6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.camera-modal-btn {
    padding: 10px 28px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.camera-modal-btn.cancel {
    background: #f0f2f5;
    color: #555;
}

.camera-modal-btn.cancel:hover {
    background: #e4e7ed;
}

.camera-modal-btn.save {
    background: #0b2b5e;
    color: white;
}

.camera-modal-btn.save:hover {
    background: #163a77;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(11, 43, 94, 0.3);
}

.camera-modal-btn.save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== ФОРМА КАМЕРЫ ===== */
.camera-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.camera-form-group {
    margin-bottom: 4px;
}

.camera-form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.camera-form-group .required {
    color: #d93434;
}

.camera-form-group input {
    width: 100%;
    padding: 8px 14px;
    border: 2px solid #e0e4ea;
    border-radius: 10px;
    font-size: 14px;
    transition: 0.25s;
    background: #fafbfc;
}

.camera-form-group input:focus {
    outline: none;
    border-color: #0b2b5e;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(11, 43, 94, 0.08);
}

.camera-toggle-row {
    margin-top: 8px;
}

.camera-toggle-row .toggle-label.small .toggle-slider {
    width: 36px;
    height: 20px;
}

.camera-toggle-row .toggle-label.small .toggle-slider::after {
    width: 16px;
    height: 16px;
}

.camera-toggle-row .toggle-label.small input:checked + .toggle-slider::after {
    left: 18px;
}

.camera-toggle-row .toggle-label.small .toggle-text {
    font-size: 13px;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #8a9bb0;
    font-size: 15px;
}

.loading-spinner i {
    font-size: 24px;
    display: block;
    margin-bottom: 10px;
}

/* ===== АДАПТАЦИЯ ===== */
@media (max-width: 600px) {
    .camera-modal-content {
        max-width: 100%;
        border-radius: 16px;
        margin: 10px;
    }
    
    .camera-form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .cameras-list {
        grid-template-columns: 1fr;
    }
    
    .camera-card .camera-card-details {
        grid-template-columns: 1fr;
    }
    
    .cameras-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-add-camera {
        justify-content: center;
    }
}
/* ============================================================
   ИНФОРМАЦИЯ О ПОДКЛЮЧЕНИИ КАМЕРЫ
   ============================================================ */

.camera-connection-info {
    margin-top: 16px;
    background: #f0f7ff;
    border-radius: 12px;
    border: 1px solid #dce8f5;
    overflow: hidden;
    animation: fadeSlideIn 0.3s ease;
}

.connection-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #e4eefa;
    font-weight: 600;
    font-size: 14px;
    color: #0b2b5e;
}

.connection-header i {
    font-size: 16px;
    color: #0b2b5e;
}

.connection-content {
    padding: 12px 16px;
}

.connection-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #eef2f6;
}

.connection-row:last-child {
    border-bottom: none;
}

.connection-label {
    min-width: 130px;
    color: #63778d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.connection-label i {
    width: 16px;
    font-size: 13px;
    color: #8a9bb0;
}

.connection-value {
    font-weight: 500;
    color: #14253d;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: rgba(255,255,255,0.5);
    padding: 2px 8px;
    border-radius: 4px;
    flex: 1;
    word-break: break-all;
}

.copy-btn {
    background: none;
    border: none;
    color: #8a9bb0;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: 0.2s;
    font-size: 14px;
}

.copy-btn:hover {
    background: #eef2f6;
    color: #0b2b5e;
}

.copy-btn.copied {
    color: #168344;
}

.connection-hint {
    padding: 10px 16px;
    background: #f8faff;
    font-size: 12px;
    color: #63778d;
    border-top: 1px solid #eef2f6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-hint i {
    color: #f0b400;
    font-size: 14px;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== АДАПТАЦИЯ ===== */
@media (max-width: 600px) {
    .connection-row {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .connection-label {
        min-width: 100%;
        font-size: 12px;
    }
    
    .connection-value {
        font-size: 12px;
        padding: 2px 6px;
    }
}
/* ============================================================
   ТОГЛ СТАТУСА КАМЕРЫ (уникальные имена)
   ============================================================ */

/* ===== КОНТЕЙНЕР ТОГЛА ===== */
.cam-toggle-row {
    margin-top: 8px;
}

.cam-toggle-row .cam-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #14253d;
    user-select: none;
}

.cam-toggle-row .cam-toggle-label input {
    display: none;
}

.cam-toggle-row .cam-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #c8d0da;
    border-radius: 12px;
    transition: 0.3s;
    flex-shrink: 0;
}

.cam-toggle-row .cam-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.cam-toggle-row .cam-toggle-label input:checked + .cam-toggle-slider {
    background: #0b2b5e;
}

.cam-toggle-row .cam-toggle-label input:checked + .cam-toggle-slider::after {
    left: 22px;
}

/* Маленький размер */
.cam-toggle-row .cam-toggle-label.small .cam-toggle-slider {
    width: 36px;
    height: 20px;
}

.cam-toggle-row .cam-toggle-label.small .cam-toggle-slider::after {
    width: 16px;
    height: 16px;
}

.cam-toggle-row .cam-toggle-label.small input:checked + .cam-toggle-slider::after {
    left: 18px;
}

.cam-toggle-row .cam-toggle-label.small .cam-toggle-text {
    font-size: 13px;
    font-weight: 500;
}

/* ===== ДЛЯ НАСТРОЕК (повторно используем, но с уникальным классом) ===== */
.settings-toggle-row .settings-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #14253d;
    user-select: none;
}

.settings-toggle-row .settings-toggle-label input {
    display: none;
}

.settings-toggle-row .settings-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #c8d0da;
    border-radius: 12px;
    transition: 0.3s;
    flex-shrink: 0;
}

.settings-toggle-row .settings-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.settings-toggle-row .settings-toggle-label input:checked + .settings-toggle-slider {
    background: #168344;
}

.settings-toggle-row .settings-toggle-label input:checked + .settings-toggle-slider::after {
    left: 22px;
}

.settings-toggle-row .settings-toggle-label.small .settings-toggle-slider {
    width: 36px;
    height: 20px;
}

.settings-toggle-row .settings-toggle-label.small .settings-toggle-slider::after {
    width: 16px;
    height: 16px;
}

.settings-toggle-row .settings-toggle-label.small input:checked + .settings-toggle-slider::after {
    left: 18px;
}

.settings-toggle-row .settings-toggle-label.small .settings-toggle-text {
    font-size: 13px;
    font-weight: 500;
}

.fa-camera:before, .fa-check:before {
    font-family: "Font Awesome 6 Free";  /* или "Font Awesome 5 Free" */
    font-weight: 900;                     /* обязательно 900 для solid */
    content: "\f030";
}




/* ============================================================
   УПРАВЛЕНИЕ УВЕДОМЛЕНИЯМИ
   ============================================================ */

.notif-section {
    background: white;
    border-radius: 16px;
    border: 1px solid #e5edf6;
    padding: 20px;
    margin-top: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.notif-header h3 {
    color: #0b2b5e;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin: 0;
}

.notif-add-btn {
    padding: 8px 20px;
    border: 0;
    border-radius: 10px;
    background: #0b2b5e;
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.notif-add-btn:hover {
    background: #1a3f72;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11, 43, 94, 0.3);
}

/* ===== ФОРМА ===== */
.notif-form {
    background: #f8faff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    border: 1px solid #eef2f6;
    animation: refNewSlide 0.3s ease;
}

.notif-form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.notif-form-group {
    flex: 1;
    min-width: 180px;
}

.notif-form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}

.notif-form-group .required {
    color: #d93434;
}

.notif-form-group input,
.notif-form-group select {
    width: 100%;
    padding: 9px 14px;
    border: 2px solid #e0e4ea;
    border-radius: 10px;
    font-size: 14px;
    transition: 0.25s;
    background: #fafbfc;
    outline: none;
    height: 40px;
}

.notif-form-group input:focus,
.notif-form-group select:focus {
    border-color: #0b2b5e;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(11, 43, 94, 0.08);
}

.notif-form-btn {
    padding: 0 24px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: #0b2b5e;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.notif-form-btn:hover {
    background: #1a3f72;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(11, 43, 94, 0.2);
}

.notif-form-btn.cancel {
    background: #f0f2f5;
    color: #555;
}

.notif-form-btn.cancel:hover {
    background: #e4e7ed;
    transform: none;
    box-shadow: none;
}

/* ===== СПИСОК ===== */
.notif-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notif-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #eef2f6;
    transition: 0.2s;
    gap: 12px;
}

.notif-item:hover {
    background: #f5f8ff;
    border-color: #dce6f2;
}

.notif-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    flex: 1;
}

.notif-email {
    font-weight: 600;
    color: #0b2b5e;
    font-size: 14px;
    word-break: break-all;
}

.notif-camera {
    font-size: 13px;
    color: #63778d;
    background: #edf3fa;
    padding: 2px 12px;
    border-radius: 10px;
    white-space: nowrap;
}

.notif-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.notif-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.notif-status.active .dot {
    background: #168344;
}

.notif-status.active {
    color: #168344;
}

.notif-status.inactive .dot {
    background: #d93434;
}

.notif-status.inactive {
    color: #d93434;
}

.notif-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.notif-actions button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.notif-toggle {
    background: #edf3fa;
    color: #0b2b5e;
}

.notif-toggle:hover {
    background: #0b2b5e;
    color: white;
}

.notif-toggle.active {
    background: #e8f5ee;
    color: #168344;
}

.notif-toggle.active:hover {
    background: #168344;
    color: white;
}

.notif-delete {
    background: transparent;
    color: #b8c8dd;
}

.notif-delete:hover {
    background: #fde8e8;
    color: #d93434;
}

/* ============================================================
   АДАПТАЦИЯ ДЛЯ ПЛАНШЕТОВ
   ============================================================ */

@media (max-width: 768px) {
    .notif-section {
        padding: 16px;
    }
    
    .notif-form-row {
        gap: 10px;
    }
    
    .notif-form-group {
        min-width: 150px;
    }
}

/* ============================================================
   АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ (телефоны)
   ============================================================ */

@media (max-width: 600px) {
    .notif-section {
        padding: 12px;
        border-radius: 12px;
    }
    
    /* ===== ХЕДЕР ===== */
    .notif-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .notif-header h3 {
        font-size: 16px;
        justify-content: center;
    }
    
    .notif-add-btn {
        justify-content: center;
        padding: 8px 16px;
        font-size: 13px;
        width: 100%;
    }
    
    /* ===== ФОРМА ===== */
    .notif-form {
        padding: 12px 14px;
        border-radius: 10px;
    }
    
    .notif-form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .notif-form-group {
        min-width: 100%;
        width: 100%;
    }
    
    .notif-form-group input,
    .notif-form-group select {
        height: 38px;
        font-size: 14px;
        padding: 7px 12px;
    }
    
    .notif-form-btn {
        justify-content: center;
        padding: 0 16px;
        height: 38px;
        font-size: 13px;
        width: 100%;
    }
    
    .notif-form-btn.cancel {
        order: 2;
    }
    
    /* ===== ЭЛЕМЕНТ СПИСКА ===== */
    .notif-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
        border-radius: 10px;
    }
    
    .notif-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
    }
    
    .notif-email {
        font-size: 14px;
        width: 100%;
        word-break: break-all;
    }
    
    .notif-camera {
        font-size: 12px;
        padding: 2px 10px;
        white-space: normal;
    }
    
    .notif-status {
        font-size: 12px;
        padding: 2px 0;
    }
    
    .notif-actions {
        width: 100%;
        justify-content: flex-end;
        gap: 8px;
        padding-top: 8px;
        border-top: 1px solid #eef2f6;
    }
    
    .notif-actions button {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
}

/* ============================================================
   АДАПТАЦИЯ ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ
   ============================================================ */

@media (max-width: 400px) {
    .notif-section {
        padding: 10px;
        border-radius: 10px;
    }
    
    .notif-header h3 {
        font-size: 14px;
        gap: 6px;
    }
    
    .notif-header h3 i {
        font-size: 14px;
    }
    
    .notif-add-btn {
        font-size: 12px;
        padding: 6px 14px;
    }
    
    .notif-form {
        padding: 10px 12px;
    }
    
    .notif-form-group label {
        font-size: 12px;
    }
    
    .notif-form-group input,
    .notif-form-group select {
        height: 36px;
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .notif-form-btn {
        height: 36px;
        font-size: 12px;
        padding: 0 12px;
    }
    
    .notif-item {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .notif-email {
        font-size: 13px;
    }
    
    .notif-camera {
        font-size: 11px;
        padding: 2px 8px;
    }
    
    .notif-status {
        font-size: 11px;
    }
    
    .notif-actions {
        gap: 6px;
        padding-top: 6px;
    }
    
    .notif-actions button {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
}






/* ===== LIVE PREVIEW ===== */
.camera-live-preview {
    background: #f8faff;
    border-radius: 16px;
    border: 2px solid #e5edf6;
    margin-bottom: 20px;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.camera-live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #0b2b5e;
    color: white;
}

.camera-live-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
}

.camera-live-close {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.7;
    transition: 0.3s;
}

.camera-live-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.camera-live-body {
    position: relative;
    min-height: 200px;
    background: #101c2c;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-live-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: white;
    padding: 30px;
}

.camera-live-loading .loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.camera-live-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.camera-live-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #f7faff;
    border-top: 1px solid #e5edf6;
}

.camera-live-status {
    font-size: 14px;
    font-weight: 500;
}

.camera-live-status.loading {
    color: #f59e0b;
}

.camera-live-status.success {
    color: #168344;
}

.camera-live-status.error {
    color: #d93434;
}

.camera-live-refresh {
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    background: #0b2b5e;
    color: white;
    cursor: pointer;
    font-size: 13px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.camera-live-refresh:hover {
    background: #1a3f72;
    transform: scale(1.03);
}

/* Кнопка "Смотреть" в карточке */
.btn-live {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    background: #0b2b5e;
    color: white;
    cursor: pointer;
    font-size: 13px;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-live:hover {
    background: #1a3f72;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(11,43,94,0.2);
}







#cameraLivePreview{
    margin-top: 20px;
}
/* ===== LIVE ПРЕВЬЮ ===== */
#cameraLivePreview {
    margin-top: 20px;
}

.live-card {
    background: #f7faff;
    border-radius: 16px;
    border: 1px solid #e5edf6;
    overflow: hidden;
}

.live-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: white;
    border-bottom: 1px solid #e5edf6;
}

.live-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0b2b5e;
    animation: live-blink 1.2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes live-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.live-card-title {
    font-weight: 600;
    font-size: 15px;
    color: #0b2b5e;
}

.live-tag {
    font-size: 10px;
    font-weight: 600;
    color: #0b2b5e;
    background: #e8f0fa;
    padding: 2px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.live-card-right {
    display: flex;
    gap: 4px;
}

.live-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #8a9bb0;
    cursor: pointer;
    transition: 0.2s;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-btn:hover {
    background: #edf3fa;
    color: #0b2b5e;
}

.live-card-body {
    position: relative;
    min-height: 200px;
    background: #101c2c;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}

.live-loading i {
    font-size: 32px;
    color: rgba(255,255,255,0.3);
}

.live-img {
    width: 100%;
    max-height: 350px;
    object-fit: contain;
}

.live-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 18px;
    background: white;
    border-top: 1px solid #e5edf6;
    font-size: 13px;
    color: #63778d;
}

.live-status.online {
    color: #168344;
}

.live-status.offline {
    color: #d93434;
}

.live-status.waiting {
    color: #f59e0b;
}

.live-time {
    font-size: 12px;
    color: #8a9bb0;
}
/* ===== СТАТУСЫ С ИКОНКАМИ ===== */
.live-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.live-status .status-icon {
    font-size: 14px;
}

.live-status.online {
    color: #168344;
}

.live-status.online .status-icon {
    color: #168344;
}

.live-status.offline {
    color: #d93434;
}

.live-status.offline .status-icon {
    color: #d93434;
}

.live-status.waiting {
    color: #f59e0b;
}

.live-status.waiting .status-icon {
    color: #f59e0b;
}




