body { 
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; 
    padding: 16px; 
    margin: 0;
    background: #f8fafc;
}
.container { max-width: 1200px; margin: 0 auto; }
h1 { margin: 0 0 24px; font-size: 28px; color: #1f2937; display: flex; align-items: center; gap: 8px; }
h1 video {  height: 32px; vertical-align: middle; margin-right: 8px; }
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 16px; 
    margin-bottom: 32px; 
}
.card { 
    background: white;
    border: 1px solid #e5e7eb; 
    border-radius: 12px; 
    padding: 20px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.card h3 { margin: 0 0 12px; font-size: 16px; color: #374151; }
.card .value { font-size: 32px; font-weight: 700; color: #1f2937; }
.card .label { font-size: 14px; color: #6b7280; margin-top: 4px; }

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chart-container h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #374151;
}

/* Стили для кнопок фильтрации инцидентов */
.incident-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.incident-filter-btn {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.incident-filter-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.incident-filter-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.incident-filter-btn.active:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Специальный контейнер для диаграммы муниципалитетов */
.municipality-chart-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.municipality-chart-container h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #374151;
    width: 100%;
}

.chart-container-inner {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.chart-left {
    flex: 0 0 auto;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-right {
    flex: 1;
    padding-left: 20px;
}

.legend-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.table-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.table-container h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #374151;
}

table { 
    border-collapse: collapse; 
    width: 100%; 
    font-size: 14px;
}
th, td { 
    border: 1px solid #e5e7eb; 
    padding: 12px 8px; 
    text-align: left;
}
th { 
    background: #f9fafb; 
    font-weight: 600;
    color: #374151;
}
.text { 
    max-width: 400px; 
    white-space: pre-wrap; 
    word-break: break-word; 
}
.nowrap { white-space: nowrap; }

/* Стили для ссылок на посты */
.post-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    transition: all 0.2s ease;
    display: inline-block;
}

.post-link:hover {
    background: #dbeafe;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.no-link {
    color: #9ca3af;
    font-style: italic;
}

/* Стили для кнопок в заголовке */
.header-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.refresh-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.refresh-btn:hover {
    background: #2563eb;
}

.docs-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.docs-btn:hover {
    background: #059669;
}

.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background: #dc2626;
}

.filter-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    flex-direction: column;
    justify-content: space-between;
}
.filter-container .inner-container {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}
.filter-container .left-container {
    display: flex;
    align-items: center;
    gap: 12px;
}
.filter-container .right-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.filter-container h3 {
    margin: 0;
    font-size: 16px;
    color: #374151;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
}

.date-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.filter-btn:hover {
    background: #059669;
}

.clear-filter-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.clear-filter-btn:hover {
    background: #4b5563;
}

.filter-info {
    background: #dbeafe;
    color: #1e40af;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-left: auto;
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    .municipality-chart-container {
        flex-direction: column;
        align-items: stretch;
    }
    .chart-left {
        width: 100%;
        height: 250px;
    }
    .chart-right {
        padding-left: 0;
        padding-top: 20px;
    }
    .legend-container {
        grid-template-columns: 1fr;
        max-height: 200px;
    }
    .filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .filter-container h3 {
        text-align: center;
    }
    .filter-info {
        margin-left: 0;
        text-align: center;
    }
}

/* Стили для секции фильтрации инцидентов */
.incident-filter-section {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.incident-filter-section h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #374151;
}

.incident-filter-section .incident-filter-buttons {
    margin-bottom: 0;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}