/* Общие стили для платформы SCM */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f8fafc;
    color: #0f172a;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #e2e8f0;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar .logo {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 32px;
    display: block;
    text-decoration: none;
    color: #0f172a;
}

.sidebar .logo span {
    color: #d4af37;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li {
    margin-bottom: 8px;
}

.sidebar nav ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: #334155;
    font-weight: 500;
    transition: 0.2s;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
    background: #eef2ff;
    color: #1e40af;
}

.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 24px 32px;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: #1e40af;
}

button {
    background: #1e40af;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

button:hover {
    opacity: 0.9;
}

/* Тёмная тема */
body.dark-theme {
    background: #0f172a;
    color: #e2e8f0;
}
body.dark-theme .card,
body.dark-theme .sidebar,
body.dark-theme .theme-switch,
body.dark-theme .branch-selector-container,
body.dark-theme .filter-bar,
body.dark-theme .form-card,
body.dark-theme .branches-container,
body.dark-theme .protocol-form,
body.dark-theme .modal-content {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
body.dark-theme .card h3,
body.dark-theme .sidebar .logo {
    color: #90cdf4;
}
body.dark-theme .badge {
    background: #334155;
    color: #cbd5e1;
}
body.dark-theme .notification {
    background: #2d3748;
    border-left-color: #f59e0b;
}
body.dark-theme .table,
body.dark-theme .registry-table,
body.dark-theme .meetings-table {
    background: #1e293b;
}
body.dark-theme th {
    background: #334155;
    color: #e2e8f0;
}
body.dark-theme td {
    border-color: #334155;
}
body.dark-theme input, body.dark-theme select, body.dark-theme textarea {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

/* Адаптивность (мобильные устройства) */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1010;
    background: #1e40af;
    color: white;
    padding: 8px 12px;
    border-radius: 30px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: 0.3s;
        position: fixed;
        z-index: 1000;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    .menu-toggle {
        display: block;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .two-columns, .frog-elephant {
        grid-template-columns: 1fr;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Дополнительные утилиты */
.badge {
    background: #eef2ff;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-block;
}
.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: #1e40af;
    width: 0%;
    border-radius: 10px;
}
.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* The flex item's default min-width otherwise expands the entire app on phones. */
@media (max-width: 768px) {
    .main-content { min-width: 0; width: 100%; }
    .main-content h1, .main-content h2, .main-content h3 { overflow-wrap: anywhere; }
    .main-content canvas, .main-content img { max-width: 100%; }
    .main-content .branch-selector-container { max-width: 100%; flex-wrap: wrap; }
    .main-content select, .main-content input { max-width: 100%; min-width: 0; }
    .main-content table { display: block; max-width: 100%; overflow-x: auto; }
}
@media (max-width: 768px) {
    .main-content .kpi-grid { grid-template-columns: minmax(0, 1fr); }
    .main-content .date-nav { flex-wrap: wrap; }
    .main-content .benchmark-bar { overflow: hidden; }
}
@media (max-width: 768px) {
    .main-content > .menu-toggle { position: relative; top: auto; left: auto; display: block; margin: 0 0 16px; border: 0; min-height: 44px; font: inherit; }
    .main-content > .menu-toggle:focus-visible { outline: 3px solid #d4af37; outline-offset: 2px; }
}
