* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

/* Верхняя строка хедера: только блок авторизации */
.header-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

/* email пользователя как "таблетка" */
.header-user {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 6px;
    background-color: #edf2f7;
    color: #2d3748;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.header-user:hover {
    background-color: #e2e8f0;
    color: #1a202c;
}

/* блок логина/выхода */
.header-auth {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* адаптация хедера под мобильные: кнопки по центру, в колонку */
@media (max-width: 640px) {
    .header-top {
        justify-content: center;
    }

    .header-auth {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .header-auth .btn-primary,
    .header-auth .btn-secondary,
    .header-user {
        width: 100%;
        max-width: 260px;
        text-align: center;
    }
}

header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center;
}

h1 {
    color: #2d3748;
    font-size: 32px;
    margin-bottom: 10px;
}

.subtitle {
    color: #718096;
    font-size: 16px;
    line-height: 1.2;
    margin-top: 1px;
    margin-bottom: 2px;
}

.stats {
    display: inline-block;
    background: #f7fafc;
    padding: 10px 20px;
    border-radius: 8px;
    color: #4a5568;
    font-weight: 500;
}

/* Ночной баннер поверх сайта */
#nightOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.night-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    pointer-events: auto;
}

.night-overlay-content {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    top: 40%;
    transform: translateY(-50%);
    padding: 20px 24px;
    background: #1a202c;
    color: #edf2f7;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.night-overlay-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.5;
}

.night-overlay-subtitle {
    font-size: 14px;
    color: #cbd5e0;
    line-height: 1.6;
    margin-bottom: 8px;
}

/* Увеличенный баннер на десктопе */
.night-overlay-large {
    max-width: 840px;
    padding: 32px 32px;
}

.night-overlay-title-large {
    font-size: 24px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.night-overlay-subtitle-large {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 14px;
}

/* Ссылка на поддержку в баннере */
.night-overlay-support-link {
    color: #f6e05e;
    font-weight: 600;
    text-decoration: underline;
}

.night-overlay-support-link:hover {
    color: #faf089;
}

/* Базовый размер для кнопок карты/модалки */
.btn-map {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    min-width: 220px;
    text-align: center;
    font-size: 14px;
    border: none;
    transition: all 0.3s;
}

.btn-map:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

/* Специализация для кнопки соседей */
.btn-neighbors {
    background-color: #2f855a;
    color: #ffffff;
}

/* Поисковая панель */
.search-panel {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.search-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.search-group label {
    display: block;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 14px;
}

.search-group input,
.search-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-group input:focus,
.search-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: #f7fafc;
    font-size: 18px;
}

.btn-icon:hover {
    background: #e2e8f0;
}

/* Основной контент */
.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    height: calc(100vh - 380px);
    min-height: 600px;
}

.results-panel,
.map-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 20px;
    border-bottom: 2px solid #f7fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    color: #2d3748;
    font-size: 18px;
}

.panel-header span {
    color: #718096;
    font-size: 14px;
}

.map-controls {
    display: flex;
    gap: 8px;
}

.results-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.result-item {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.result-item:hover {
    background: #edf2f7;
    border-color: #667eea;
    transform: translateX(5px);
}

.result-item.active {
    border-color: #667eea;
    background: #e6f2ff;
}

.result-profession {
    font-size: 12px;
    color: #555;
    margin-top: 2px;
}

.result-header {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.result-photo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.result-photo.placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.result-info {
    flex: 1;
}

.result-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 16px;
    margin-bottom: 5px;
}

.result-dates {
    color: #718096;
    font-size: 13px;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 13px;
    color: #4a5568;
}

.result-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

#map {
    flex: 1;
    min-height: 400px;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 15px;
    border-top: 2px solid #f7fafc;
    flex-wrap: wrap;
}

.pagination button {
    min-width: 40px;
    padding: 8px 12px;
    background: #f7fafc;
    color: #4a5568;
    font-size: 14px;
}

.pagination button:hover:not(:disabled) {
    background: #e2e8f0;
}

.pagination button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #718096;
}

.modal-close:hover {
    color: #2d3748;
}

/* Фото в модалке */
.modal-photo {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 20px;
    display: block;
}

/* Дополнительная обёртка фото по центру */
.person-card-photo-wrapper-center {
    margin: 8px 0 10px;
    text-align: center;
}

.person-card-photo-wrapper-center .modal-photo {
    max-width: 220px;
    max-height: 260px;
}

.person-card-location {
    margin-bottom: 8px;
}

.person-card-cemetery {
    margin-bottom: 2px;
    color: #2b6cb0;
    font-weight: 500;
}

.person-card-coords {
    font-size: 12px;
    color: #4a5568;
}

/* Блок профессии в результатах поиска */
.result-profession {
    font-size: 12px;
    color: #555;
    margin-top: 2px;
}

/* Блок званий и заслуг в карточке (во всю ширину) */
.person-card-honors {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.person-card-honors-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.person-card-honors-value {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}
/* Попап для соседних могил */
.neighbor-popup {
    font-size: 13px;
    line-height: 1.4;
    max-width: 220px;
}

.neighbor-popup-name {
    font-weight: 600;
    margin-bottom: 6px;
    color: #2d3748;
}

.neighbor-popup-btn {
    margin-bottom: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    border: none;
    background: #2b6cb0;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

.neighbor-popup-btn:hover {
    background: #2c5282;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.neighbor-popup-btn:disabled {
    background: #a0aec0;
    cursor: default;
    box-shadow: none;
}

.neighbor-popup-distance {
    margin-top: 2px;
    color: #4a5568;
    font-size: 12px;
}

.neighbor-popup-radius {
    margin-top: 2px;
    color: #718096;
    font-size: 11px;
}

/* Leaflet попап */
.leaflet-popup-content {
    margin: 15px;
    min-width: 200px;
}

.popup-photo {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.popup-name {
    font-weight: 600;
    font-size: 14px;
    color: #2d3748;
    margin-bottom: 5px;
}

.popup-info {
    font-size: 12px;
    color: #718096;
    line-height: 1.5;
}

ORDER BY created_at ASC, id ASC
/* Футер в стиле uolega.ru */
.footer {
    margin-top: 20px;
    background: linear-gradient(135deg, #6150d4 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    color: #edf2f7;
    text-align: center;
    padding: 24px 20px 20px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer h3 {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 700;
}

.footer p {
    font-size: 14px;
    margin-bottom: 4px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0 0.3rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #D4AF37;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1.3rem;
    border-radius: 30px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
}

.footer-links a:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: #D4AF37;
    transform: translateY(-2px);
}

.footer .location {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.4rem;
}

/* Блок доната в футере */
.footer-donate {
    margin: 18px 0 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #1a202c;
    color: #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.footer-donate-text {
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

.footer-donate-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 999px;
    background: #3182ce;
    color: #f7fafc;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.45);
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.footer-donate-button:hover {
    background: #2b6cb0;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(49, 130, 206, 0.6);
}

.footer-donate-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(49, 130, 206, 0.5);
}

@media (max-width: 640px) {
    .footer-donate {
        flex-direction: column;
    }
}

/* Кнопка поддержки в шапке/футере */
.footer-support-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #ecc94b;
    color: #1a202c !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.footer-support-btn:hover {
    background: #f6e05e;
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.45);
}

.footer-support-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Спиннер рядом с кнопкой поиска */
.search-loader {
    display: none;
    margin-left: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #a0aec0;
    border-top-color: #2b6cb0;
    animation: spin 0.7s linear infinite;
}

.search-loader.active {
    display: inline-block;
}

.btn-primary.loading {
    opacity: 0.6;
    pointer-events: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Карточка покойного в модалке */
.person-card {
    padding: 12px 4px 4px;
    font-size: 14px;
    color: #2d3748;
}

person-card-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.person-card-main {
    flex: 1;
    min-width: 0;
}

.person-card-name {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
}

.person-card-dates {
    margin-bottom: 4px;
    color: #4a5568;
}

.person-card-photo-wrapper {
    flex: 0 0 auto;
}

.modal-photo {
    max-width: 160px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}

.person-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px 16px;
    margin-bottom: 12px;
}

.modal-info-item {
    display: flex;
    flex-direction: row;
    gap: 4px;
    font-size: 13px;
}

.modal-info-label {
    min-width: 120px;
    color: #718096;
}

.modal-info-value {
    color: #2d3748;
}

/* Блок кнопок карт */
.person-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.btn-map {
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 4px;
    border: none;
}

.btn-map-link {
    text-decoration: none;
}

/* Разделитель */
.person-card-divider {
    margin: 8px 0 10px;
    border-top: 1px solid #e2e8f0;
}

/* Форма фото/исправлений */
.person-card-photo-form {
    font-size: 13px;
}

.person-card-photo-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 500;
    color: #2d3748;
}

person-card-photo-text {
    margin: 0 0 8px;
    color: #718096;
}

person-card-form-row {
    margin-bottom: 6px;
}

person-card-form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 3px;
    color: #4a5568;
}

.person-card-form-input,
.person-card-form-textarea {
    width: 100%;
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #cbd5e0;
    box-sizing: border-box;
}

.person-card-form-textarea {
    resize: vertical;
    min-height: 60px;
}

.person-card-form-submit {
    margin-top: 4px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
}

/* Обёртка для карты и оверлей загрузки */
.map-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
}

/* Оверлей загрузки карты */
.map-loader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 500;
}

.map-loader.active {
    display: flex;
}

.map-loader-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #a0aec0;
    border-top-color: #2b6cb0;
    animation: spin 0.7s linear infinite;
    margin-bottom: 8px;
}

.map-loader-text {
    font-size: 14px;
    color: #4a5568;
}

/* Cookie баннер */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1a202c;
  color: #edf2f7;
  padding: 12px 16px;
  z-index: 9999;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.3);
  font-size: 14px;
}

.cookie-banner__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.cookie-banner a {
  color: #90cdf4;
  text-decoration: underline;
}

.cookie-banner .btn-primary {
  white-space: nowrap;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
    }

    .results-panel {
        max-height: 400px;
    }

    #map {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .search-row {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 24px;
    }

    .search-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-actions button {
        width: 100%;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.8rem;
    }

    .footer-links a {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
}

/* Адаптация ночного баннера под мобильные */
@media (max-width: 480px) {
    .night-overlay-content,
    .night-overlay-large {
        max-width: 92%;
        padding: 18px 14px;
    }

    .night-overlay-title-large {
        font-size: 18px;
        line-height: 1.35;
        margin-bottom: 12px;
    }

    .night-overlay-subtitle-large {
        font-size: 15px;
        line-height: 1.45;
        margin-bottom: 10px;
    }
}

@media (max-width: 640px) {
    .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .footer-support-btn {
        margin-left: 0;
        margin-top: 6px;
    }
}

/* Баннер поддержки проекта */
.support-banner {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.75);
    z-index: 9999;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.support-banner__content {
    background: #1a202c;
    color: #edf2f7;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    padding: 28px 32px;
    max-width: 720px;
    width: 80%;
    text-align: left;
}

.support-banner__title {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 20px;
}

.support-banner__text {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.support-banner__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.support-banner__support-link {
    display: inline-block;
    padding: 10px 18px;
    font-size: 14px;
    border-radius: 999px;
    text-decoration: none;
    background: #f6e05e;
    color: #1a202c;
    font-weight: 600;
}

.support-banner__support-link:hover {
    background: #ecc94b;
}

.auth-success-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 20px;
}

.auth-success-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: 32px 28px 28px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.auth-success-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.auth-success-card h1 {
  color: #2d3748;
  font-size: 26px;
  margin: 0 0 12px;
}

.auth-success-text {
  color: #4a5568;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.auth-credentials {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
}

.auth-credential-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
}

.auth-credential-row:last-child {
  margin-bottom: 0;
}

.auth-credential-label {
  color: #718096;
  font-weight: 500;
  white-space: nowrap;
}

.auth-credential-value {
  color: #1a202c;
  font-weight: 600;
  word-break: break-all;
  text-align: right;
}

.auth-success-actions {
  display: flex;
  justify-content: center;
}

.auth-success-actions .btn {
  min-width: 200px;
}

/* Флеш-сообщения в хедере */
.header-flash-messages {
  margin-bottom: 16px;
}

.flash-message {
  background: #ffffff;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 16px;
  line-height: 1.4;
  color: #c53030;
  font-weight: 700;
  border-left: 4px solid #c53030;
}

/* Успешное сообщение с ID/паролем */
.flash-message-success {
  border-left-color: #c53030;
  background: #fdf2f2;
}

.flash-message-text {
  margin-bottom: 10px;
}

.flash-message-credentials {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #fed7d7;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.flash-credential-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 15px;
}

.flash-credential-row:last-child {
  margin-bottom: 0;
}

.flash-credential-label {
  color: #c53030;
  font-weight: 600;
}

.flash-credential-value {
  color: #1a202c;
  font-weight: 700;
  word-break: break-all;
  text-align: right;
}

.flash-message-actions {
  margin-top: 6px;
  text-align: right;
}

.flash-message-actions .btn {
  font-size: 14px;
  padding: 6px 12px;
}

/* Модалка увеличенного фото */

.photo-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.0);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  transition: background 0.2s ease-out;
}

.photo-modal.photo-modal-visible {
  display: flex;
  background: rgba(0, 0, 0, 0.85);
}

.photo-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  background: #fff;
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

.photo-modal.photo-modal-visible .photo-modal-content {
  transform: scale(1);
  opacity: 1;
}

.photo-modal-content img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
  cursor: move; /* мышью можно перетаскивать */
}

.photo-modal-close {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 28px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  line-height: 30px;
  text-align: center;
}

.photo-modal-caption {
  text-align: center;
  padding: 8px 0 0;
  font-size: 14px;
  color: #333;
}

.modal-photo {
  cursor: zoom-in;
}

.users-admin-page {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.users-admin-page .table-responsive {
    width: 100%;
    overflow-x: auto;
}

.users-table {
    width: 100%;
    min-width: 1450px;
}

.users-table td,
.users-table th {
    font-size: 13px;
    vertical-align: middle;
}

.users-table th {
    white-space: nowrap;
}

.users-table th a {
    color: inherit;
    text-decoration: none;
}

.users-table th a:hover {
    text-decoration: underline;
}

.users-table .badge {
    font-size: 11px;
}

.admin-card {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 5px;
}

.admin-help {
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 13px;
}

.promo-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.promo-form label {
    margin: 0;
}

.promo-form input[type="number"] {
    width: 80px;
    margin-left: 5px;
}

.inactive-panel {
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
}

.inactive-panel__content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.users-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.users-filter-form input {
    width: 200px;
}

.users-filter-form input[name="search_ip"] {
    width: 120px;
}

.users-filter-form select {
    width: auto;
}

.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 145px;
}

.user-actions form {
    display: inline;
    margin: 0;
}

.pending-payment-count {
    color: #e53e3e;
    font-size: 11px;
}

/*
 * Активная оплаченная подписка.
 * Используем !important, потому что Bootstrap .table-striped
 * задаёт фон через более сильный селектор.
 */
.users-table tbody tr.paid-subscription-row > td {
    background-color: #e8f5e9 !important;
    border-top-color: #a5d6a7;
    border-bottom-color: #a5d6a7;
}

.users-table tbody tr.paid-subscription-row:hover > td {
    background-color: #c8e6c9 !important;
}

/*
 * Активная промо-подписка.
 */
.users-table tbody tr.promo-subscription-row > td {
    background-color: #fff8e1 !important;
    border-top-color: #ffe082;
    border-bottom-color: #ffe082;
}

.users-table tbody tr.promo-subscription-row:hover > td {
    background-color: #ffecb3 !important;
}

/*
 * Истёкшая подписка остаётся нейтральной.
 */
.users-table tbody tr.expired-subscription-row > td {
    background-color: #f8f9fa !important;
    color: #6c757d;
}

.subscription-paid-badge {
    color: #198754;
    font-weight: 600;
}

.subscription-promo-badge {
    color: #b7791f;
    font-weight: 600;
}

.subscription-expired {
    color: #6c757d;
}

.user-details {
    font-size: 13px;
}

.user-details code {
    word-break: break-all;
}

.promo-duration-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.promo-duration-row label {
    flex: 1;
}

.promo-duration-row input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
}

@media (max-width: 600px) {
    .promo-duration-row {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .users-admin-page {
        padding-left: 8px;
        padding-right: 8px;
    }

    .promo-form,
    .users-filter-form {
        align-items: stretch;
        flex-direction: column;
    }

    .promo-form label,
    .users-filter-form input,
    .users-filter-form select,
    .users-filter-form button,
    .users-filter-form a {
        width: 100%;
    }

    .promo-form input[type="number"] {
        width: 100%;
        margin-left: 0;
    }

    .inactive-panel__content {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 600px) {
  .photo-modal-content {
    padding: 6px;
    max-width: 100%;
    max-height: 100%;
  }
}

.role-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.role-user {
  color: #4a5568;
  background: #edf2f7;
}

.role-editor {
  color: #2b6cb0;
  background: #bee3f8;
}

.role-moderator {
  color: #975a16;
  background: #feebc8;
}

.role-admin {
  color: #9b2c2c;
  background: #fed7d7;
}

.news-banner__item-date {
    font-size: 11px;
    color: #64748b;
    margin: 2px 0 6px;
}

@media (max-width: 640px) {
    .support-banner__content {
        max-width: 92%;
        padding: 20px 18px;
        border-radius: 12px;
    }

    .support-banner__title {
        font-size: 18px;
    }

    .support-banner__text {
        font-size: 14px;
    }
}

  .news-invite {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 16px;
    padding: 16px 18px;
    background: linear-gradient(
      135deg,
      #eef7ff 0%,
      #f8fbff 100%
    );
    border: 1px solid #b8d8f5;
    border-left: 4px solid #2f80c0;
    border-radius: 8px;
    box-shadow: 0 2px 7px rgba(
      30,
      80,
      120,
      0.08
    );
  }

  .news-invite-icon {
    display: flex;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    background: #dceeff;
    border-radius: 50%;
    font-size: 21px;
  }

  .news-invite-content {
    min-width: 0;
  }

  .news-invite-title {
    margin: 0 0 6px 0;
    color: #243447;
    font-size: 17px;
    font-weight: 700;
  }

  .news-invite-text {
    margin: 0 0 11px 0;
    color: #526575;
    font-size: 14px;
    line-height: 1.5;
  }

  .news-invite-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #1769aa;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition:
      color 0.2s ease,
      gap 0.2s ease;
  }

  .news-invite-link:hover {
    gap: 10px;
    color: #0d4f83;
    text-decoration: underline;
  }

  .news-invite-link:focus-visible {
    outline: 3px solid rgba(
      47,
      128,
      192,
      0.35
    );
    outline-offset: 3px;
    border-radius: 3px;
  }

  @media (max-width: 600px) {
    .news-invite {
      padding: 14px;
    }

    .news-invite-title {
      font-size: 16px;
    }

    .news-invite-text {
      font-size: 13px;
    }
  }