/* style.css */
:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F3F4F6;
    --sidebar-bg: #1F2937;
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --danger: #EF4444;
    --success: #10B981;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; }

body { display: flex; height: 100vh; background-color: var(--bg-color); color: var(--text-main); }

/* Боковое меню */
.sidebar { width: 260px; background: var(--sidebar-bg); color: white; display: flex; flex-direction: column; }
.logo { padding: 24px; font-size: 24px; font-weight: bold; border-bottom: 1px solid #374151; }
.logo span { color: var(--primary); }
.nav-menu { padding: 20px 0; display: flex; flex-direction: column; gap: 5px; }
.nav-item { padding: 15px 24px; color: #D1D5DB; text-decoration: none; display: flex; align-items: center; gap: 12px; transition: 0.2s; cursor: pointer; }
.nav-item:hover, .nav-item.active { background: #374151; color: white; border-left: 4px solid var(--primary); }

/* Основной контент */
.main-content { flex: 1; padding: 40px; overflow-y: auto; position: relative; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.header h1 { font-size: 28px; }

/* Секции (вкладки) */
.section { display: none; animation: fadeIn 0.3s; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Карточки и инпуты */
.card { background: var(--surface); padding: 24px; border-radius: 12px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); margin-bottom: 30px; }
.control-panel { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.input-group { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 200px; }
.input-group label { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.input-group select, .input-group input { padding: 10px 14px; border: 1px solid #D1D5DB; border-radius: 8px; font-size: 15px; outline: none; }
.input-group select:focus, .input-group input:focus { border-color: var(--primary); }

/* Кнопки */
.btn { padding: 12px 24px; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Сетка камер */
.camera-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.camera-card { background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.camera-header { padding: 16px; background: #F9FAFB; border-bottom: 1px solid #E5E7EB; font-weight: 600; display: flex; justify-content: space-between; }
.status-indicator { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.dot { width: 10px; height: 10px; background: #D1D5DB; border-radius: 50%; }
.recording .dot { background: var(--danger); animation: pulse 1.5s infinite; }
video { width: 100%; aspect-ratio: 16/9; background: #111827; object-fit: cover; display: block; }

/* Таблица архива */
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 16px; border-bottom: 1px solid #E5E7EB; }
th { background: #F9FAFB; font-weight: 600; color: var(--text-muted); }
tr:hover { background: #F3F4F6; }

/* Шкала громкости микрофона */
.mic-meter-container {
    width: 100%;
    height: 6px;
    background: #1F2937;
    position: relative;
    overflow: hidden;
}
.mic-level-bar {
    height: 100%;
    width: 0%;
    background: var(--success);
    transition: width 0.05s ease-out, background-color 0.2s;
}

/* === КРАСИВЫЕ УВЕДОМЛЕНИЯ (TOASTS) === */
.toast-container {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.toast {
    background: var(--surface);
    color: var(--text-main);
    min-width: 300px;
    max-width: 450px;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
    font-weight: 500;
    transform: translateX(120%);
    animation: slideInToast 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    border-left: 6px solid;
}

.toast.hiding {
    animation: slideOutToast 0.3s ease-in forwards;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: #F59E0B; }
.toast.info { border-left-color: var(--primary); }

.toast .icon { font-size: 24px; }
.toast.success .icon { color: var(--success); }
.toast.error .icon { color: var(--danger); }
.toast.warning .icon { color: #F59E0B; }
.toast.info .icon { color: var(--primary); }

@keyframes slideInToast {
    to { transform: translateX(0); }
}
@keyframes slideOutToast {
    to { transform: translateX(120%); opacity: 0; }
}

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

