.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(6px); justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: white; border-radius: 32px; width: 90%; max-width: 700px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); animation: slideUp 0.3s ease; overflow: hidden; }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 24px 28px 16px 28px; border-bottom: 1px solid #eef2ff; }
.modal-header h2 { font-size: 1.5rem; font-weight: 600; display: flex; gap: 12px; align-items: center; margin: 0; }
.modal-header h2 i { color: #3b82f6; }
.close-modal { background: none; border: none; font-size: 28px; cursor: pointer; color: #94a3b8; transition: color 0.2s; line-height: 1; }
.close-modal:hover { color: #ef4444; }
#addForm, #collectionForm, #invoiceForm, #employeeForm { padding: 16px 24px 8px 24px; }
.form-row { display: flex; gap: 20px; margin-bottom: 8px; flex-wrap: wrap; }
.form-group { flex: 1; min-width: 180px; margin-bottom: 20px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 8px; color: #334155; font-size: 0.85rem; }
.form-group label i { margin-right: 8px; color: #3b82f6; }
.form-group input, .form-group select { width: 100%; padding: 12px 14px; border: 1.5px solid #e2e8f0; border-radius: 16px; font-family: 'Inter', sans-serif; font-size: 0.9rem; background: white; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.form-group select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>"); background-repeat: no-repeat; background-position: right 14px center; }
.form-actions { display: flex; justify-content: flex-end; gap: 16px; padding: 16px 24px 28px 24px; background: #fafcff; border-radius: 0 0 32px 32px; margin-top: 8px; }
.btn { padding: 10px 24px; border-radius: 40px; font-weight: 600; cursor: pointer; border: none; transition: 0.2s; font-size: 0.9rem; }
.btn.cancel { background: #f1f5f9; color: #475569; }
.btn.cancel:hover { background: #e2e8f0; }
.btn.add { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3); }
.btn.add:hover { transform: translateY(-1px); filter: brightness(1.02); }
#viewCollectionInfo { margin: 0 24px 16px 24px; flex-shrink: 0; }
#peopleListContainer { flex: 1; overflow-y: auto; padding: 0 24px; }
#peopleTable { width: 100%; border-collapse: collapse; }
#peopleTable th, #peopleTable td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #e2e8f0; }
#peopleTable th { background: #f8fafc; font-weight: 600; }
#addPersonSection { flex-shrink: 0; padding: 16px 24px; background: inherit; border-top: 1px solid #e2e8f0; margin-top: auto; }
#addPersonForm { display: none; margin-top: 16px; background: #f8fafc; border-radius: 20px; padding: 16px; }
.delete-person-btn:hover { transform: scale(1.2); color: #dc2626; }
#searchPersonInput, #searchInvoiceInput { padding: 8px 12px; border-radius: 20px; border: 1px solid #ccc; width: 180px; font-family: inherit; }
body.dark-theme #viewCollectionInfo, body.dark-theme #viewInvoiceInfo { background: #0f172a; color: #e2e8f0; border: 1px solid #334155; border-radius: 16px; padding: 12px; margin-bottom: 16px; }
body.dark-theme #peopleTable th, body.dark-theme #invoiceDetailsTable th { background: #0f172a; color: #e2e8f0; border-bottom-color: #334155; }
body.dark-theme #peopleTable td, body.dark-theme #invoiceDetailsTable td { border-bottom-color: #334155; color: #cbd5e1; }
body.dark-theme #addPersonForm { background: #0f172a; }
body.dark-theme #searchPersonInput, body.dark-theme #searchInvoiceInput { background: #0f172a; border-color: #334155; color: white; }
#collectionsChecklist { background: #f8fafc; border-radius: 16px; padding: 12px; }
body.dark-theme #collectionsChecklist { background: #0f172a; }
#collectionsChecklist label { padding: 8px; border-radius: 12px; transition: background 0.2s; }
#collectionsChecklist label:hover { background: #e2e8f0; }
body.dark-theme #collectionsChecklist label:hover { background: #334155; }
#viewInvoiceInfo { margin: 0 24px 16px 24px; flex-shrink: 0; }
#invoiceDetailsContainer { flex: 1; overflow-y: auto; padding: 0 24px; }
#editModal .modal-content { max-width: 600px; }
#editModal .form-row { display: flex; gap: 20px; margin-bottom: 8px; flex-wrap: wrap; }
#editModal .form-group { flex: 1; min-width: 180px; margin-bottom: 20px; }
#editModal .form-group label { display: block; font-weight: 500; margin-bottom: 8px; color: #334155; font-size: 0.85rem; }
#editModal .form-group label i { margin-right: 8px; color: #3b82f6; }
#editModal .form-group input, #editModal .form-group select { width: 100%; padding: 12px 14px; border: 1.5px solid #e2e8f0; border-radius: 16px; font-family: 'Inter', sans-serif; font-size: 0.9rem; background: white; }
#editModal .form-group input:focus, #editModal .form-group select:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
#editModal .form-actions { display: flex; justify-content: flex-end; gap: 16px; padding: 16px 24px 28px 24px; background: #fafcff; border-radius: 0 0 32px 32px; margin-top: 8px; }
body.dark-theme #editModal .form-group label { color: #cbd5e1; }
body.dark-theme #editModal .form-group input, body.dark-theme #editModal .form-group select { background: #0f172a; border-color: #334155; color: white; }
body.dark-theme #editModal .form-actions { background: #0f172a; }
body.dark-theme #schoolsInfo, body.dark-theme #peopleInfo { background-color: #1e293b !important; color: #e2e8f0 !important; border: 1px solid #334155 !important; border-radius: 12px !important; padding: 12px !important; }
#peopleModal { z-index: 1001; }
#schoolsModal { z-index: 1000; }
.edit-topic-btn, .delete-topic-btn { background: none !important; border: none !important; cursor: pointer; font-size: 1.1rem; padding: 4px 8px; border-radius: 20px; transition: all 0.2s; }
.edit-topic-btn { color: #3b82f6 !important; }
.edit-topic-btn:hover { background: #dbeafe !important; }
.delete-topic-btn { color: #ef4444 !important; }
.delete-topic-btn:hover { background: #fee2e2 !important; }
body.dark-theme .edit-topic-btn { color: #60a5fa !important; }
body.dark-theme .edit-topic-btn:hover { background: #1e40af !important; }
body.dark-theme .delete-topic-btn:hover { background: #7f1a1a !important; }
body.dark-theme #schoolPeopleList { background: #0f172a; border-color: #334155; color: white; }
body.dark-theme #searchSchoolInput, body.dark-theme #searchPersonInput, body.dark-theme #searchInvoiceInput { background: #0f172a; border-color: #334155; color: white; }
body.dark-theme #searchSchoolInput::placeholder, body.dark-theme #searchPersonInput::placeholder, body.dark-theme #searchInvoiceInput::placeholder { color: #94a3b8; }
body.dark-theme #schoolLogsList .status-item .status-icon { background: #334155; color: #94a3b8; }
body.dark-theme #schoolLogsList .status-item.active .status-icon { background: #3b82f6; color: white; }
body.dark-theme #schoolLogsList .status-name { color: #e2e8f0; }
body.dark-theme #schoolLogsList .status-date { color: #94a3b8; }

/* Жёсткая фиксация ширины модалки участников */
#peopleModal .modal-content { width: 1300px !important; max-width: 95vw !important; min-width: 1040px !important; height: 85vh !important; display: flex !important; flex-direction: row !important; padding: 0 !important; overflow: hidden !important; }
.card-info-grid { background: #f8fafc; border-radius: 16px; padding: 16px; }
body.dark-theme .card-info-grid { background: #0f172a; }
.card-info-item { padding: 6px 0; border-bottom: 1px solid #e2e8f0; }
body.dark-theme .card-info-item { border-bottom-color: #334155; }
.card-info-item:last-child { border-bottom: none; }

.card-scores-table th, .card-scores-table td { border-bottom: 1px solid #e2e8f0; }
body.dark-theme .card-scores-table th, body.dark-theme .card-scores-table td { border-bottom-color: #334155; }
.card-scores-header { background: #f1f5f9; }
body.dark-theme .card-scores-header { background: #1e293b; }
.card-scores-overall { background: #e0f2fe; }
body.dark-theme .card-scores-overall { background: #1e3a5f; }

.card-full-name { font-size: 3.2rem; font-weight: 700; line-height: 1.2; margin: 0; color: #1e293b; }
body.dark-theme .card-full-name { color: #f1f5f9; }
.card-section { margin-bottom: 10px; }
.card-section-title { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; gap: 8px; }
body.dark-theme .card-section-title { color: #94a3b8; border-bottom-color: #334155; }
.card-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
.card-info-item { font-size: 0.85rem; padding: 3px 0; }
.card-scores-table { width: 100%; border-collapse: collapse; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); font-size: 0.85rem; }
.card-scores-table th, .card-scores-table td { padding: 5px 10px; text-align: left; border-bottom: 1px solid #e2e8f0; background: white; }
body.dark-theme .card-scores-table th, body.dark-theme .card-scores-table td { background: #1e293b; border-bottom-color: #334155; }
.card-scores-table th { font-weight: 600; background: #f8fafc; }
body.dark-theme .card-scores-table th { background: #0f172a; }
.card-scores-header th { font-weight: 600; }
.card-scores-table tbody tr:last-child td { border-bottom: none; }
.card-score { text-align: center; font-weight: 500; }
.card-scores-overall td { font-weight: 700; background: #e0f2fe; font-size: 0.95rem; }
body.dark-theme .card-scores-overall td { background: #1e3a5f; }

.btn.danger { background: #ef4444; color: white; }
.btn.danger:hover { background: #dc2626; }

.form-group-sm { margin-bottom: 10px; }
.form-group-sm label { display: block; font-weight: 500; margin-bottom: 4px; color: #334155; font-size: 0.8rem; }
.form-group-sm label i { margin-right: 6px; color: #3b82f6; }
.form-group-sm input, .form-group-sm select, .form-group-sm textarea { width: 100%; padding: 8px 10px; border: 1.5px solid #e2e8f0; border-radius: 12px; font-family: 'Inter', sans-serif; font-size: 0.85rem; background: white; }
.form-group-sm input:focus, .form-group-sm select:focus, .form-group-sm textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.form-row-sm { display: flex; gap: 12px; margin-bottom: 10px; }
.form-row-sm .form-group-sm { flex: 1; min-width: 150px; }
.form-actions-sm { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; margin-top: 4px; background: transparent; }
body.dark-theme .form-group-sm label { color: #cbd5e1; }
body.dark-theme .form-group-sm input, body.dark-theme .form-group-sm select, body.dark-theme .form-group-sm textarea { background: #0f172a; border-color: #334155; color: white; }

.form-group-sm { margin-bottom: 8px; }
.form-group-sm label { display: block; font-weight: 500; margin-bottom: 3px; color: #334155; font-size: 0.8rem; }
.form-group-sm label i { margin-right: 6px; color: #3b82f6; }
.form-group-sm input, .form-group-sm select, .form-group-sm textarea { width: 100%; padding: 7px 10px; border: 1.5px solid #e2e8f0; border-radius: 12px; font-family: 'Inter', sans-serif; font-size: 0.85rem; background: white; }
.form-group-sm input:focus, .form-group-sm select:focus, .form-group-sm textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.form-row-sm { display: flex; gap: 10px; margin-bottom: 8px; }
.form-row-sm .form-group-sm { flex: 1; min-width: 150px; }
.form-actions-sm { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; margin-top: 4px; background: transparent; }
body.dark-theme .form-group-sm label { color: #cbd5e1; }
body.dark-theme .form-group-sm input, body.dark-theme .form-group-sm select, body.dark-theme .form-group-sm textarea { background: #0f172a; border-color: #334155; color: white; }

/* ========== СТИЛИ ДЛЯ DISABLED В ТЁМНОЙ ТЕМЕ (например, поле даты окончания сбора) ========== */
body.dark-theme input:disabled,
body.dark-theme input[readonly] {
  background: #0f172a !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
  opacity: 0.7;
  cursor: not-allowed;
}

/* ========== ФИКСАЦИЯ ЗАГОЛОВКОВ В ПРАВЫХ ПАНЕЛЯХ С ИСТОРИЕЙ/СТАТУСАМИ ========== */
#peopleModal .modal-content > div:last-child,
#schoolsModal .modal-content .status-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
#peopleModal .modal-content > div:last-child .modal-header,
#schoolsModal .modal-content .status-panel .modal-header {
  flex-shrink: 0;
  border-bottom: 1px solid #e2e8f0;
}
#peopleModal #schoolLogsList,
#schoolsModal #collectionStatusList {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  margin: 0;
}

/* Правая панель статусов в модалке школ */
#schoolsModal .status-panel {
  background: #f8fafc;
}
body.dark-theme #schoolsModal .status-panel {
  background: #0f172a !important;
}
#schoolsModal .status-panel .modal-header {
  border-bottom: 1px solid #e2e8f0;
}
body.dark-theme #schoolsModal .status-panel .modal-header {
  border-bottom-color: #334155;
}
#schoolsModal .status-panel h2 {
  color: #1e293b;
}
body.dark-theme #schoolsModal .status-panel h2 {
  color: #e2e8f0;
}

/* Правая панель истории в модалке участников */
#peopleModal .status-panel {
  background: #f8fafc;
}
body.dark-theme #peopleModal .status-panel {
  background: #0f172a !important;
}
#peopleModal .status-panel .modal-header {
  border-bottom: 1px solid #e2e8f0;
}
body.dark-theme #peopleModal .status-panel .modal-header {
  border-bottom-color: #334155;
}
#peopleModal .status-panel h2 {
  color: #1e293b;
}
body.dark-theme #peopleModal .status-panel h2 {
  color: #e2e8f0;
}

/* Списки статусов и логов */
#collectionStatusList .status-name {
  color: #1e293b;
}
body.dark-theme #collectionStatusList .status-name {
  color: #e2e8f0;
}
#collectionStatusList .status-date {
  color: #64748b;
}
body.dark-theme #collectionStatusList .status-date {
  color: #94a3b8;
}
#schoolLogsList .status-name {
  color: #1e293b;
}
body.dark-theme #schoolLogsList .status-name {
  color: #e2e8f0;
}
#schoolLogsList .status-date {
  color: #64748b;
}
body.dark-theme #schoolLogsList .status-date {
  color: #94a3b8;
}
.leaflet-bottom.leaflet-right {
  opacity: 0 !important;
  pointer-events: none;
  z-index: -1000 !important;
}