/* Современный дизайн для аналитики доноров */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.analytics-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Заголовок страницы */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Выбор донора */
.donor-selector {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.selector-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
}

.selector-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.selector-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.search-section label {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.donor-search-container {
    position: relative;
    width: 100%;
}

.donor-search {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    background-color: white;
    border-bottom: none;
    transition: all 0.3s ease;
}

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

.donor-dropdown {
    width: 100%;
    border: 2px solid #e1e5e9;
    border-radius: 0 0 8px 8px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    max-height: 400px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

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

.donor-dropdown option {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s;
}

.donor-dropdown option:hover {
    background-color: #f8f9fa;
}

.donor-dropdown option:selected {
    background-color: #667eea;
    color: white;
}

/* Подсветка доноров по дате обновления */
.donor-dropdown option.donor-outdated-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.donor-dropdown option.donor-outdated-critical {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    font-weight: 600;
}

/* Кнопка расширенного поиска */
.advanced-search-toggle {
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.advanced-search-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.advanced-search-toggle:active {
    transform: translateY(0);
}

/* Контейнер расширенного поиска */
.advanced-search {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
    animation: slideDown 0.3s ease-out;
}

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

.advanced-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.advanced-search-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.clear-filters-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-filters-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.4);
}

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

.advanced-search-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.advanced-search-field label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.advanced-search-input {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    transition: all 0.3s ease;
}

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

.advanced-search-input:not(:placeholder-shown) {
    border-color: #28a745;
    background-color: #f8fff9;
}

.advanced-search-results {
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
}

/* Кнопки действий */
.action-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.button-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    justify-content: center;
    min-height: 42px;
    white-space: normal;
    text-align: center;
    flex: 1;
    line-height: 1.3;
}

.btn-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.refresh-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.refresh-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.refresh-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.edit-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.edit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.edit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mass-edit-btn {
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(111, 66, 193, 0.3);
}

.mass-edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.4);
}

.refresh-list-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.refresh-list-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

/* Оверлей редактирования внутри модалки донора */
.edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(2px);
}

.edit-overlay-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    width: 360px;
    max-width: 90%;
    overflow: hidden;
}

.edit-overlay-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-overlay-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.edit-overlay-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.edit-overlay-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.edit-overlay-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.edit-overlay-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.edit-overlay-field label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #555;
}

.edit-overlay-field .form-input {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.edit-overlay-actions {
    padding: 12px 16px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #e9ecef;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85rem;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.panel-content {
    padding: 20px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-input {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

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

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* Основная информация */
.main-info {
    background: white;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0;
}

.info-section {
    padding: 20px;
    border-right: 1px solid #e1e5e9;
    border-bottom: 1px solid #e1e5e9;
}

.info-section:last-child {
    border-right: none;
}

.info-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item .label {
    font-weight: 500;
    color: #666;
    flex: 1;
}

.info-item .value {
    font-weight: 600;
    color: #333;
    text-align: right;
    flex: 1;
}

.chart-button-container {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
}

.chart-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.chart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* График */
.chart-container {
    background: white;
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.chart-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chart-type-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-type-selector label {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.chart-type-buttons {
    display: flex;
    gap: 5px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
}

.chart-type-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.chart-type-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.chart-type-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #007bff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.zoom-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.hide-chart-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.hide-chart-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.chart-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
}

.chart-info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chart-info-item .label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.chart-info-item .value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Выделение сроков окупаемости */
#chartPaybackJapanPeriod,
#chartPaybackRussiaPeriod {
    color: #007bff;
    font-weight: 700;
    font-size: 15px;
}

.chart-wrapper {
    padding: 30px;
    position: relative;
}

#analyticsChart {
    max-width: 100%;
    height: auto;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    padding: 15px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.legend-color.sales {
    background-color: #007bff;
}

.legend-color.receipts {
    background-color: #28a745;
}

.legend-color.payback-japan {
    background-color: #ffc107;
}

.legend-color.payback-russia {
    background-color: #dc3545;
}

.legend-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Модальное окно информации о доноре */
.donor-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.donor-modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: 1400px;
    overflow-y: auto;
    position: relative;
}

.modal-body {
    max-height: calc(95vh - 80px);
    overflow-y: auto;
}

/* Модальное окно массового редактирования */
.mass-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 95vw;
    max-height: 95vh;
    width: 1200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.modal-title {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.modal-title h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.modal-title p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
}

.nav-donor-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav-donor-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

.nav-donor-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.modal-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.update-badge {
    display: inline-block;
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 12px;
    white-space: nowrap;
    font-weight: 600;
    vertical-align: middle;
    letter-spacing: 0.02em;
}

.update-badge.badge-fresh {
    background: rgba(40, 167, 69, 0.3);
    color: #fff;
}

.update-badge.badge-warning {
    background: rgba(255, 193, 7, 0.5);
    color: #fff;
}

.update-badge.badge-critical {
    background: rgba(220, 53, 69, 0.55);
    color: #fff;
}

.modal-header-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.modal-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.modal-action-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

/* Фильтры */
.filters-section {
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
}

.filters-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.filter-input {
    padding: 10px 14px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

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

.filter-input:not(:placeholder-shown) {
    border-color: #28a745;
    background-color: #f8fff9;
}

.filter-input:not(:placeholder-shown):focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}



/* Таблица доноров */
.donors-table-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
}

.table-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

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

.select-all-btn, .deselect-all-btn, .refresh-donors-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.select-all-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.select-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.deselect-all-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.deselect-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.refresh-donors-btn {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.refresh-donors-btn:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

.refresh-donors-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.table-container {
    flex: 1;
    overflow: auto;
    max-height: 350px;
}

.donors-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.donors-table th,
.donors-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.donors-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.donors-table tbody tr:hover {
    background: #f8f9fa;
}

.checkbox-col {
    width: 50px;
    text-align: center;
}

.donors-table input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
}

.donors-table input[type="number"],
.donors-table input[type="date"] {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.donors-table input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Пагинация */
.pagination-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.pagination-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.page-numbers {
    display: flex;
    gap: 8px;
    margin: 0 15px;
}

.page-number {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-number:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.page-number.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.pagination-settings {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-settings label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.items-per-page {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.items-per-page:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Действия */
.mass-edit-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e5e9;
    gap: 15px;
}

.selected-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 150px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    flex-direction: row;
}

.mass-update-btn, .mass-edit-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.mass-update-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.mass-update-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.mass-update-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mass-edit-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.mass-edit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.mass-edit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* Плейсхолдер с анимацией */
.placeholder-cell {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    z-index: 1001;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    min-height: 200px;
    justify-content: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top: 6px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.placeholder-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}

.placeholder-line {
    font-size: 22px;
    color: #ffffff;
    font-weight: 700;
    animation: fadeInOut 2s ease-in-out infinite;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.placeholder-line:nth-child(1) {
    animation-delay: 0s;
}

.placeholder-line:nth-child(2) {
    animation-delay: 0.7s;
}

.placeholder-line:nth-child(3) {
    animation-delay: 1.4s;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Состояния загрузки */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.error-message {
    color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
}

.success-message {
    color: #155724;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(21, 87, 36, 0.2);
}

/* Система уведомлений */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.hide {
    transform: translateX(100%);
    opacity: 0;
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin: 0;
}

.notification-message {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    background: #f5f5f5;
    color: #666;
}

/* Типы уведомлений */
.notification.success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #ffffff 100%);
}

.notification.success .notification-icon {
    color: #28a745;
}

.notification.error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #ffffff 100%);
}

.notification.error .notification-icon {
    color: #dc3545;
}

.notification.warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
}

.notification.warning .notification-icon {
    color: #ffc107;
}

.notification.info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #d1ecf1 0%, #ffffff 100%);
}

.notification.info .notification-icon {
    color: #17a2b8;
}

/* Анимация появления */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification.slide-in {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification.slide-out {
    animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Адаптивность */
@media (max-width: 1400px) {
    .action-btn {
        font-size: 12px;
        padding: 8px 12px;
        gap: 6px;
        min-height: 40px;
    }

    .btn-icon {
        font-size: 13px;
    }
}

@media (max-width: 1200px) {
    .analytics-container {
        padding: 15px;
    }

    .modal-content {
        width: 95vw;
        height: 95vh;
    }

    .action-buttons {
        gap: 8px;
    }

    .button-row {
        gap: 8px;
    }

    .action-btn {
        font-size: 11px;
        padding: 8px 10px;
        min-height: 38px;
    }
}

@media (max-width: 900px) {
    .action-buttons {
        flex-direction: column;
    }

    .button-row {
        width: 100%;
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
        font-size: 13px;
        padding: 12px 16px;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .selector-content {
        padding: 15px;
        gap: 15px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .button-row {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .action-btn {
        width: 100%;
        font-size: 13px;
        padding: 12px 16px;
        white-space: nowrap;
    }

    .donor-modal-content {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-body {
        max-height: calc(100vh - 80px);
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .chart-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .chart-legend {
        flex-direction: column;
        align-items: center;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mass-edit-actions {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .selected-info {
        text-align: center;
        min-width: auto;
    }
    
    .action-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .table-controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .select-all-btn, .deselect-all-btn, .refresh-donors-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .mass-update-btn, .mass-edit-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .notifications-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .notification {
        min-width: auto;
        max-width: none;
    }
}