/* Общие стили для всего приложения */
* { 
    box-sizing: border-box; 
}

body { 
    font-family: Arial, sans-serif; 
    margin: 0; 
    padding: 20px; 
    background: #f5f5f5; 
}

.container { 
    max-width: 2000px; 
    margin: 0 auto; 
    background: white; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
}

.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
    padding-bottom: 10px; 
    border-bottom: 1px solid #eee; 
}

.user-info { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.logout-btn { 
    background: #dc3545; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    padding: 8px 15px; 
    cursor: pointer; 
    text-decoration: none; 
}

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

.form-group { 
    margin-bottom: 20px; 
    padding: 15px; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
}

label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: bold; 
}

select, button, input { 
    padding: 10px 15px; 
    font-size: 14px; 
    margin: 5px; 
}

button { 
    background: #007cba; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    min-width: 200px; 
}

button:hover { 
    background: #005a87; 
}

button:disabled { 
    background: #ccc; 
    cursor: not-allowed; 
}

.scroll-container {
  overflow-x: auto;
  margin-bottom: 20px;
}

.scroll-container table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

.scroll-container table th,
.scroll-container table td {
  word-break: break-word;
  white-space: normal;
  padding: 8px;
  border: 1px solid #ddd;
}

.message { 
    padding: 10px; 
    margin: 10px 0; 
    border-radius: 4px; 
}

.success { 
    background: #d4edda; 
    color: #155724; 
    border: 1px solid #c3e6cb; 
}

.error { 
    background: #f8d7da; 
    color: #721c24; 
    border: 1px solid #f5c6cb; 
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 20px; 
    font-size: 12px; 
}

th, td { 
    border: 1px solid #ddd; 
    padding: 8px; 
    text-align: left; 
}

th { 
    background: #f8f9fa; 
    font-weight: bold; 
    position: sticky; 
    top: 0; 
}

/*
tr:nth-child(even) { 
    background: #f9f9f9; 
}
*/

.stats { 
    background: #e9ecef; 
    padding: 15px; 
    border-radius: 4px; 
    margin: 20px 0; 
    font-weight: bold; 
}

.student-info { 
    background: #d1ecf1; 
    padding: 15px; 
    border-radius: 4px; 
    margin: 10px 0; 
}

.step { 
    margin-bottom: 30px; 
}

.step-title { 
    font-size: 18px; 
    font-weight: bold; 
    margin-bottom: 10px; 
    color: #333; 
}

.scroll-container { 
    overflow-x: auto; 
    max-height: 600px; 
    overflow-y: auto; 
}

.section-title { 
    background: none; 
    color: black; 
    padding: 1px; 
    margin: 20px 0 10px 0; 
    border-radius: 4px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.section-subtitle { 
    background: #6c757d; 
    color: white; 
    padding: 8px; 
    margin: 15px 0 10px 0; 
    border-radius: 4px; 
}

.attended-true { 
    background: #d4edda; 
}

.attended-false { 
    background: #f8d7da; 
}

.hours-count { 
    font-weight: bold; 
    color: #007cba; 
}

.hours-info { 
    font-size: 11px; 
    color: #666; 
    margin-top: 3px; 
}

.progress-bar { 
    background: #e9ecef; 
    border-radius: 4px; 
    height: 20px; 
    margin: 5px 0; 
}

.progress-fill { 
    background: #28a745; 
    height: 100%; 
    border-radius: 4px; 
    text-align: center; 
    color: white; 
    font-size: 11px; 
    line-height: 20px; 
}

.payment-success { 
    background: #d4edda; 
}

.payment-pending { 
    background: #fff3cd; 
}

.payment-failed { 
    background: #f8d7da; 
}

.amount { 
    font-weight: bold; 
    color: #28a745; 
}

.student-select { 
    width: 400px; 
    padding: 8px; 
}

.student-option { 
    padding: 8px; 
    border-bottom: 1px solid #eee; 
}

.student-option:hover { 
    background: #f0f0f0; 
}

.student-fullname { 
    font-weight: bold; 
}

.student-email { 
    color: #666; 
    font-size: 12px; 
}

.student-id { 
    color: #999; 
    font-size: 11px; 
    float: right; 
}

.print-btn { 
    background: #28a745; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    padding: 5px 10px; 
    cursor: pointer; 
    font-size: 12px; 
    margin-left: 10px; 
}

.print-btn:hover { 
    background: #218838; 
}

.section-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 10px; 
}

.student-search-container { 
    position: relative; 
}

.student-suggestions { 
    position: absolute; 
    top: 100%; 
    left: 0; 
    right: 0; 
    background: white; 
    border: 1px solid #ddd; 
    border-top: none; 
    max-height: 300px; 
    overflow-y: auto; 
    z-index: 1000; 
    display: none; 
}

.student-suggestion { 
    padding: 10px; 
    cursor: pointer; 
    border-bottom: 1px solid #eee; 
}

.student-suggestion:hover { 
    background: #f0f0f0; 
}

.student-suggestion.active { 
    background: #007cba; 
    color: white; 
}

/* Стили для формы авторизации */
.login-container { 
    background: white; 
    padding: 30px; 
    border-radius: 8px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    width: 100%; 
    max-width: 400px; 
    margin: 0 auto; 
}

.login-container h1 { 
    text-align: center; 
    margin-bottom: 30px; 
    color: #333; 
}

.login-help { 
    font-size: 10pt; 
    text-align: center; 
    margin-bottom: 3px; 
    color: gray; 
}

.login-container .form-group { 
    margin-bottom: 20px; 
    border: none; 
    padding: 0; 
}

.login-container label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: bold; 
    color: #555; 
}

.login-container input[type="email"], .login-container input[type="password"] { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    font-size: 14px; 
}

.login-container button { 
    width: 100%; 
    padding: 12px; 
    background: #007cba; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 16px; 
}

.login-container button:hover { 
    background: #005a87; 
}

/* Стили для управления группами */
.groups-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.groups-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.groups-header p {
    opacity: 0.9;
}

.nav-tabs {
    display: flex;
    background: white;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.nav-tab {
    flex: 1;
    padding: 1rem;
    text-align: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.nav-tab:hover {
    background: #f8f9fa;
}

.nav-tab.active {
    background: #007cba;
    color: white;
}

.tab-content {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.tab-content.active {
    display: block;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #007cba;
}

.group-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.group-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #007cba;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.group-card h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.group-card p {
    color: #666;
    margin-bottom: 0.5rem;
}

.student-count {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.results-table {
    margin-top: 1rem;
}

.success-badge {
    background: #d4edda;
    color: #155724;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.875rem;
}

.error-badge {
    background: #f8d7da;
    color: #721c24;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.875rem;
}

.student-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    min-width: 200px;
    text-align: center;
}

.btn:hover {
    background: #005a87;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

/* Стили для печати */
@media print {
    body * {
        visibility: hidden;
    }
    .container, .container * {
        visibility: visible;
    }
    .container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: none;
        box-shadow: none;
        padding: 10px;
    }
    .header, .step, .form-group, .message, .stats, .student-info, .print-btn, .logout-btn, .user-info span,
    .student-search-container, .section-header .print-btn, .nav-tabs, .tab-content:not(.active) {
        display: none !important;
    }
    table {
        font-size: 10px;
        page-break-inside: auto;
    }
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    .section-title {
        background: #007cba !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
    }
    .scroll-container {
        max-height: none;
        overflow: visible;
    }
}

/* Стили для управления группами */
.groups-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.groups-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.groups-header p {
    opacity: 0.9;
}
.nav-tabs {
    display: flex;
    background: white;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.nav-tab {
    flex: 1;
    padding: 1rem;
    text-align: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}
.nav-tab:hover {
    background: #f8f9fa;
}
.nav-tab.active {
    background: #007cba;
    color: white;
}
.tab-content {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}
.tab-content.active {
    display: block;
}
.group-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.group-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #007cba;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}
.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}
.group-card h3 {
    color: #333;
    margin-bottom: 0.5rem;
}
.group-card p {
    color: #666;
    margin-bottom: 0.5rem;
}
.student-count {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}
.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}
.results-table {
    margin-top: 1rem;
}
.success-badge {
    background: #d4edda;
    color: #155724;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.875rem;
}
.error-badge {
    background: #f8d7da;
    color: #721c24;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.875rem;
}
.student-actions {
    display: flex;
    gap: 0.5rem;
}

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

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

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

/* Скрываем неудачные платежи по умолчанию */
.payment-failed {
    display: none;
}

/* Показываем неудачные платежи когда чекбокс активен */
.show-failed-payments .payment-failed {
    display: table-row;
}

.individual-therapy {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107;
}

.individual-badge {
    background: #ffc107;
    color: #856404;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 8px;
}

/* Combobox стили */
.combobox-container {
    position: relative;
    width: 100%;
}

.combobox-wrapper {
    position: relative;
}

.combobox-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.combobox-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dropdown-list {
    padding: 0;
}

.dropdown-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

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

/* Стили для фильтра программ */
.programs-filter {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.filter-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 15px;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-small:hover {
    background: #5a6268;
}

.btn-primary {
    background: #007bff;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #0056b3;
}

.programs-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: white;
    border-radius: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
    background: white;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #007bff;
    border-color: #007bff;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark:after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.status-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.filter-info {
    margin-left: 15px;
    color: #6c757d;
    font-size: 14px;
}

.filter-notice {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 10px;
    color: #0066cc;
}

.filter-notice i {
    margin-right: 5px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .programs-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

.student-checkbox-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.student-checkbox-item:hover {
    background-color: #f8f9fa;
}

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

.students-checklist {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
}

/* Стили для поиска платежей */
.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

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

.search-info {
    color: #666;
    font-size: 14px;
}

.search-mode-badge {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 10px;
}

/* Стили для модального окна */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.full-width {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    background-color: #e9e9e9;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.btn-small:hover {
    background-color: #0b7dda;
}

.btn-edit {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    color: #666;
}

.btn-edit:hover {
    color: #2196F3;
}

/* Дополнительные стили */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .search-grid {
        grid-template-columns: 1fr;
    }
    
    .modal {
        width: 95%;
        margin: 10px;
    }
}

/* Стили для вкладок */
.tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.tabs a {
    padding: 15px 25px;
    text-decoration: none;
    color: #666;
    font-weight: bold;
    font-size: 16px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tabs a:hover {
    background-color: #e9ecef;
    color: #333;
}

.tabs a.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    background-color: white;
}

/* Стили для контейнера вкладок */
.tab-content {
    background: white;
    border-radius: 0 0 8px 8px;
    padding: 0;
}

/* Адаптивность для вкладок */
@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
    }
    
    .tabs a {
        padding: 12px 15px;
        border-bottom: 1px solid #eee;
        border-right: none;
    }
    
    .tabs a.active {
        border-bottom: 3px solid #1976d2;
    }
}

/* Стили для активных фильтров */
.active-filters {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    padding: 12px 15px;
    margin: 15px 0;
    font-size: 14px;
}

.active-filters strong {
    color: #2e7d32;
    margin-right: 10px;
}

.filter-indicator {
    background: #4caf50;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin: 0 5px;
    display: inline-block;
}