/* ============================================================
   ProCosma - Основные стили (оптимизированная версия)
   Версия: 0.4.32
   ============================================================ */

/* ============ ГЛОБАЛЬНЫЕ СБРОСЫ И БАЗА ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #111111;
    padding: 24px;
}

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

/* ============ БАЗОВЫЕ СТИЛИ ДЛЯ ССЫЛОК ============ */
a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s, opacity 0.2s;
}

a:hover {
    color: #004499;
    text-decoration: underline;
}

a:visited {
    color: #551a8b;
}

a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
}

a.btn:hover {
    text-decoration: none;
}

a[href^="tel:"] {
    color: #0066cc;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
}

a[href^="tel:"]:hover {
    text-decoration: underline;
}

a[href^="mailto:"] {
    color: #0066cc;
    text-decoration: none;
}

a[href^="mailto:"]:hover {
    text-decoration: underline;
}

/* ============ SAFE AREA (iPhone с чёлкой) ============ */
.header {
    padding-top: max(env(safe-area-inset-top, 0), 12px);
    padding-left: max(env(safe-area-inset-left, 0), 20px);
    padding-right: max(env(safe-area-inset-right, 0), 20px);
}

.modal-overlay {
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.modal-content {
    margin-top: env(safe-area-inset-top, 0);
    margin-bottom: env(safe-area-inset-bottom, 0);
}

.stats-header {
    padding-top: max(env(safe-area-inset-top, 0), 12px);
}

.app-header {
    padding-top: max(env(safe-area-inset-top, 0), 12px);
}

.phone-context-menu {
    margin-top: env(safe-area-inset-top, 0);
}

.notification-toast {
    top: max(70px, calc(env(safe-area-inset-top, 0) + 20px));
}

.notification-dropdown {
    top: max(60px, calc(env(safe-area-inset-top, 0) + 20px));
}

.cookie-consent {
    padding-bottom: max(env(safe-area-inset-bottom, 0), 16px);
}

.global-loader {
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.photo-viewer-overlay {
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.auth-modal-content {
    margin-top: max(env(safe-area-inset-top, 0), 10px);
    margin-bottom: max(env(safe-area-inset-bottom, 0), 10px);
}

.modal-buttons button {
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0));
}

#appRoot {
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.client-page-container {
    margin-top: max(40px, env(safe-area-inset-top, 0));
    margin-bottom: max(40px, env(safe-area-inset-bottom, 0));
}

.cosmetologist-info-card {
    padding-top: max(20px, env(safe-area-inset-top, 0));
}

/* Ссылки внутри карточек */
.card-content a {
    color: #0066cc;
}

.card-content a:hover {
    color: #004499;
}

/* Ссылки в шапке */
.header a {
    color: inherit;
}

.header a:hover {
    text-decoration: none;
}

/* Ссылки в футере */
footer a {
    color: #667eea;
}

footer a:hover {
    color: #5a67d8;
}

/* Ссылка-логотип */
.logo-link {
    text-decoration: none;
}

.logo-link:hover {
    text-decoration: none;
}

/* ============ ШАПКА ============ */
.header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #ffffff;
    min-height: 70px;
    flex-shrink: 0;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-row-top .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cosmetologist-avatar,
.user-name,
.status-badge {
    cursor: pointer;
}

.logo-link {
    text-decoration: none;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo img {
    height: 32px;
    width: 32px;
    aspect-ratio: 1/1;
    object-fit: contain;
    display: block;
}

.logo span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-avatar-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
}

.cosmetologist-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-logout {
    background: #2a2a2a;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.btn-logout:hover {
    opacity: 0.8;
}

.header-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-clinic {
    background: #f5f7fa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #1a202c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-clinic:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.clinic-selector-wrapper {
    position: relative;
}

.clinic-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    min-width: 260px;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #eef2f6;
}

.clinic-dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.clinic-dropdown-item:hover {
    background: #f8fafc;
}

.clinic-dropdown-item.active {
    background: #eff6ff;
    color: #667eea;
}

.clinic-name-truncate {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* ============ УВЕДОМЛЕНИЯ ============ */
.notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 18px;
    color: #666666;
    transition: transform 0.2s;
}

.notification-bell:hover {
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: #ffffff;
    border-radius: 50%;
    font-size: 10px;
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
    display: none;
}

.notification-dropdown {
    width: 380px;
    max-height: 500px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 10000;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
}

.notification-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.close-notif {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

.notif-group {
    border-bottom: 1px solid #f0f0f0;
}

.notif-group-title {
    padding: 8px 16px;
    background: #f8f9fa;
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}

.notif-item.unread {
    background: #f0f7ff;
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-referral { background: #e8f5e9; color: #2ecc71; }
.notif-bot { background: #e3f2fd; color: #2196f3; }
.notif-error { background: #ffebee; color: #dc3545; }
.notif-warning { background: #fff3e0; color: #f39c12; }
.notif-success { background: #e8f5e9; color: #2ecc71; }
.notif-info { background: #e3f2fd; color: #2196f3; }

.notif-content {
    flex: 1;
}

.notif-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.notif-message {
    font-size: 12px;
    color: #666666;
    margin-bottom: 4px;
    word-break: break-word;
}

.notif-time {
    font-size: 10px;
    color: #999999;
}

.notif-mark-read {
    background: none;
    border: none;
    cursor: pointer;
    color: #667eea;
    font-size: 14px;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.notif-mark-read:hover {
    opacity: 1;
}

.empty-notifications {
    text-align: center;
    padding: 40px;
    color: #999999;
}

.notification-footer {
    padding: 12px 16px;
    border-top: 1px solid #eeeeee;
    text-align: center;
}

.mark-all-read-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    padding: 8px;
    border-radius: 20px;
    transition: background 0.2s;
}

.mark-all-read-btn:hover {
    background: #f0f0ff;
}

/* ============ КНОПКИ ДЕЙСТВИЙ ============ */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 16px;
}

.btn-find,
.btn-add {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-find:hover,
.btn-add:hover {
    opacity: 0.8;
}

.btn-find.active {
    background: #2ecc71;
}

/* ============ ПОИСК ============ */
.search-bar {
    margin-bottom: 32px;
}

.search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.search-field {
    flex: 1;
    min-width: 180px;
}

.search-field input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #dddddd;
    background: #ffffff;
    font-size: 14px;
    border-radius: 8px;
}

.search-field input:focus {
    outline: none;
    border-color: #999999;
}

.btn-clear {
    background: #f0f0f0;
    border: 1px solid #dddddd;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-clear:hover {
    background: #e0e0e0;
}

/* ============ СОРТИРОВКА ============ */
.sort-select-wrapper {
    position: relative;
    min-width: 220px;
}

.sort-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #dddddd;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    font-size: 13px;
    gap: 8px;
}

.sort-select-trigger .custom-select-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333333;
}

.sort-select-trigger .custom-select-placeholder i {
    width: 16px;
    color: #667eea;
}

.sort-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 220px;
    max-height: 300px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 8px;
    margin-top: 4px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sort-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.sort-option:last-child {
    border-bottom: none;
}

.sort-option:hover {
    background: #f5f5f5;
}

.sort-option.selected {
    background: #e3f2fd;
    color: #1976d2;
}

.sort-option.selected i {
    color: #1976d2;
}

.sort-option i {
    width: 18px;
    color: #999999;
}

/* ============ СЕТКА КЛИЕНТОВ ============ */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
    min-height: 400px;
}

.client-card {
    background: #ffffff;
    border: 1px solid #eeeeee;
    overflow: hidden;
    border-radius: 16px;
    transition: box-shadow 0.2s;
}

.client-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.client-photo-large {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: #f5f5f5;
    display: block;
    cursor: pointer;
}

.card-content {
    padding: 20px 20px 24px;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.client-name {
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.client-name i {
    font-size: 20px;
}

.action-icons {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    color: #333333;
    transition: all 0.2s;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
}

.icon-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.icon-btn[data-edit-id] {
    background: #e3f2fd;
    color: #1976d2;
}

.icon-btn[data-edit-id]:hover {
    background: #bbdef5;
}

.icon-btn[data-delete-id] {
    background: #ffebee;
    color: #dc3545;
}

.icon-btn[data-delete-id]:hover {
    background: #ffcdd2;
}

.client-details-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #555555;
}

.client-details-row span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.client-details-row i {
    width: 16px;
    color: #999999;
}

.phone-link {
    cursor: pointer;
    color: #0066cc;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.contraindications-row {
    font-size: 14px;
    color: #555555;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.contraindications-label {
    font-weight: 500;
    color: #333333;
}

/* ============ УСЛУГИ ============ */
.service-section {
    margin-top: 16px;
    border-top: 1px solid #eeeeee;
    padding-top: 16px;
    padding-bottom: 16px;
}

.service-section:last-child {
    padding-bottom: 0;
}

.service-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999999;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.service-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

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

.service-item:hover {
    background: #fafafa;
}

.service-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.service-date {
    color: #888888;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.service-date.future {
    color: #2ecc71;
    font-weight: 500;
}

.service-date.overdue {
    color: #dc3545;
    font-weight: 600;
}

.service-date.upcoming {
    color: #2ecc71;
    font-weight: 500;
}

.service-date.future-task {
    color: #f39c12;
    font-weight: 500;
}

.service-rating-badge {
    font-size: 11px;
    margin-left: 8px;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.star-rating-mini {
    color: #dddddd;
    font-size: 10px;
}

.star-rating-mini.active {
    color: #ffc107;
}

.service-price {
    font-size: 12px;
    color: #2ecc71;
    background: #e8f5e9;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.show-all-btn {
    background: none;
    border: 1px solid #dddddd;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: normal;
    cursor: pointer;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #666666;
    transition: all 0.2s;
}

.show-all-btn:hover {
    background: #f0f0f0;
    border-color: #cccccc;
    color: #333333;
}

/* ============ КНОПКИ В КАРТОЧКЕ ============ */
.card-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-card {
    flex: 1;
    background: #2a2a2a;
    color: #ffffff;
    border: none;
    padding: 12px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-card:hover {
    background: #111111;
}

.btn-card-link {
    background: #e0e0e0;
    color: #111111;
}

.btn-card-link:hover {
    background: #d0d0d0;
}

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

.btn-card-apps:hover {
    opacity: 0.9;
}

/* ============ КНОПКИ ЗАГРУЗКИ/УДАЛЕНИЯ ФОТО ============ */
.btn-upload-photo, .btn-clear-photo {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    color: #1976d2;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    min-width: 44px;
    justify-content: center;
}

.btn-upload-photo:hover {
    background: #bbdef5;
    transform: translateY(-1px);
}

.btn-clear-photo {
    background: #ffebee;
    border-color: #ef9a9a;
    color: #d32f2f;
}

.btn-clear-photo:hover {
    background: #ffcdd2;
    transform: translateY(-1px);
}

/* ============ ФОТОАЛЬБОМ ============ */
.photo-album-section {
    margin-top: 16px;
    border-top: 1px solid #eeeeee;
    padding-top: 16px;
}

.photo-album-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.photo-album-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1/1;
    background: #f5f5f5;
}

.photo-album-item:hover {
    opacity: 0.9;
}

.photo-album-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
    display: block;
}

.photo-album-item:hover img {
    transform: scale(1.05);
}

.photo-album-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 6px;
    color: #ffffff;
    font-size: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.empty-photos {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #999999;
}

.photo-album-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.photo-album-actions .btn-add-photo,
.photo-album-actions .btn-view-all-photos {
    flex: 1;
    background: #f0f0f0;
    border: none;
    padding: 10px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: opacity 0.2s;
}

.photo-album-actions .btn-add-photo {
    background: #2a2a2a;
    color: #ffffff;
}

.photo-album-actions .btn-add-photo:hover {
    opacity: 0.8;
}

.photo-album-actions .btn-view-all-photos {
    background: #e0e0e0;
    color: #333333;
}

.photo-album-actions .btn-view-all-photos:hover {
    background: #d0d0d0;
}

/* ============ МОДАЛЬНЫЕ ОКНА ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.modal-content {
    background: #ffffff;
    max-width: 800px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border-radius: 16px;
    padding: 24px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.btn-modal-cancel {
    background: transparent;
    border: 1px solid #dddddd;
    padding: 12px 24px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-modal-save {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-modal-cancel.btn-delete {
    background: #ffebee;
    color: #dc3545;
    border: 1px solid #ef9a9a;
}

.btn-modal-cancel.btn-delete:hover {
    background: #ffcdd2;
}

/* ============ ФОРМЫ ============ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dddddd;
    font-size: 14px;
    font-family: inherit;
    border-radius: 8px;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #999999;
}

.inline-fields {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.inline-fields .form-group {
    flex: 1;
}

/* ============ ЧЕКБОКСЫ ============ */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px 12px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    background: #fafafa;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 0;
    margin: 0;
}

.checkbox-group label:hover {
    background: #f0f0f0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

/* ============ ПАГИНАЦИЯ ============ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.pagination button {
    background: #ffffff;
    border: 1px solid #dddddd;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pagination button.active {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

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

/* ============ ПАНЕЛЬ СПРАВОЧНИКОВ ============ */
.settings-panel {
    background: #ffffff;
    border: 1px solid #eeeeee;
    padding: 24px;
    margin-top: 40px;
    border-radius: 16px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.settings-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-all-btn {
    background: none;
    border: 1px solid #dddddd;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.toggle-all-btn:hover {
    background: #f0f0f0;
}

.dict-section {
    border: 1px solid #f0f0f0;
    margin-bottom: 15px;
    background: #fafafa;
    border-radius: 12px;
    overflow: visible;
}

.dict-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #f0f0f0;
    cursor: pointer;
    user-select: none;
}

.dict-section-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dict-toggle-btn {
    font-size: 14px;
    transition: transform 0.2s;
}

.dict-toggle-btn.collapsed {
    transform: rotate(-90deg);
}

.dict-section-content {
    padding: 16px;
    transition: all 0.3s;
    max-height: none;
    overflow: visible;
}

.dict-section-content.collapsed {
    display: none;
}

.dict-items {
    margin-bottom: 12px;
}

.dict-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 12px 16px;
    border: 1px solid #eeeeee;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 8px;
}

.dict-item:hover {
    background: #f9f9f9;
    border-color: #dddddd;
}

.dict-name {
    flex: 1;
    font-size: 14px;
}

.dict-actions {
    display: flex;
    gap: 8px;
}

.dict-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    color: #666666;
}

.dict-actions button:hover {
    color: #000000;
}

.btn-add-dict {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-add-dict:hover {
    opacity: 0.8;
}

/* ============ МУЛЬТИ-ЗАГРУЗКА ФОТО ============ */
.multi-photo-upload {
    margin-bottom: 20px;
}

.multi-photo-label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.photo-limit-badge {
    background: #667eea;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: normal;
}

.multi-photo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.multi-photo-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #eeeeee;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.multi-photo-preview {
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.multi-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
    display: block;
}

.multi-photo-preview:hover img {
    transform: scale(1.05);
}

.multi-photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px;
}

.multi-photo-view,
.multi-photo-delete {
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.multi-photo-view:hover {
    background: #667eea;
    transform: scale(1.1);
}

.multi-photo-delete:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.multi-photo-add {
    width: 100px;
    height: 100px;
    border: 2px dashed #dddddd;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.multi-photo-add:hover {
    border-color: #667eea;
    background: #f0f0ff;
    transform: translateY(-2px);
}

.multi-photo-add.drag-over {
    border-color: #2ecc71;
    background: #e8f5e9;
}

.multi-photo-add-icon {
    font-size: 24px;
    color: #999999;
    margin-bottom: 4px;
}

.multi-photo-add-text {
    font-size: 10px;
    color: #999999;
    text-align: center;
    padding: 0 8px;
}

.multi-photo-hint {
    font-size: 11px;
    color: #999999;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* ============ КАСТОМНЫЙ ВЫПАДАЮЩИЙ СПИСОК ============ */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid #dddddd;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    font-size: 14px;
}

.custom-select-trigger .custom-select-placeholder {
    flex: 1;
    color: #333333;
}

.custom-select-trigger i {
    color: #999999;
    transition: transform 0.2s;
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 8px;
    margin-top: 4px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.custom-select-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #f0f0f0;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background: #f5f5f5;
}

.custom-select-option.app-option {
    background: linear-gradient(135deg, #667eea05, #764ba205);
    border-left: 3px solid #667eea;
}

.custom-select-group-label {
    padding: 8px 12px;
    background: #f0f0f0;
    font-size: 12px;
    font-weight: 600;
    color: #666666;
    border-bottom: 1px solid #dddddd;
}

.app-badge-mini {
    background: #667eea;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 9px;
    margin-left: 8px;
}

/* ============ ТАРИФЫ ============ */
.tariff-comparison {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.tariff-card {
    flex: 1;
    min-width: 180px;
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.tariff-card.user { border-top: 4px solid #94a3b8; }
.tariff-card.pro { border-top: 4px solid #667eea; }
.tariff-card.pro-plus { border-top: 4px solid #f59e0b; }

.tariff-card.active-tariff::before {
    content: "ВАШ ТАРИФ";
    position: absolute;
    top: 20px;
    right: -30px;
    background: #dc3545;
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    padding: 4px 30px;
    transform: rotate(45deg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.tariff-card h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.tariff-card .price {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.tariff-card ul {
    text-align: left;
    margin: 0 0 16px 0;
    padding-left: 20px;
    font-size: 12px;
}

.tariff-card li {
    margin-bottom: 6px;
}

.btn-current {
    background: #e2e8f0;
    color: #475569;
    border: none;
    padding: 8px 12px;
    border-radius: 24px;
    font-size: 13px;
    cursor: default;
    width: 100%;
}

.btn-upgrade {
    background: #667eea;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 24px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
}

.btn-upgrade:hover {
    opacity: 0.9;
}

/* Прогресс-бары */
.limit-item {
    margin-bottom: 16px;
}

.limit-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}

progress {
    width: 100%;
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
}

progress::-webkit-progress-bar { background-color: #e2e8f0; border-radius: 10px; }
progress::-webkit-progress-value { background-color: #667eea; border-radius: 10px; }

/* ============ ТАРИФЫ - ПРАВИЛА ============ */
.tariff-rules {
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
    padding-top: 16px;
}

.rules-header {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #667eea;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.rules-header i {
    transition: transform 0.2s;
}

.rules-header.open i {
    transform: rotate(90deg);
}

.rules-content {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.rules-content ul {
    margin: 0;
    padding-left: 20px;
}

.rules-content li {
    margin-bottom: 10px;
}

.rules-full-link {
    margin-top: 12px;
    text-align: right;
}

.rules-full-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 12px;
}

/* ============ СТАТУС БЕЙДЖИ ============ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
    white-space: nowrap;
}

.status-badge i {
    font-size: 10px;
}

.status-badge-pro {
    background: #667eea;
    color: #ffffff !important;
}

.status-badge-pro-plus {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #333333 !important;
}

/* ============ КОНТЕКСТНОЕ МЕНЮ ДЛЯ ТЕЛЕФОНА ============ */
.phone-context-menu {
    position: absolute;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-width: 220px;
    z-index: 10060;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.15s, transform 0.15s;
    transform-origin: top left;
}

.phone-context-menu.show {
    opacity: 1;
    transform: scale(1);
}

.phone-context-menu-header {
    padding: 14px 16px;
    background: #667eea;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    font-weight: 500;
}

.phone-context-menu-item {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.phone-context-menu-item:last-child {
    border-bottom: none;
}

.phone-context-menu-item:hover {
    background: #f5f5f5;
}

.phone-context-menu-item:active {
    background: #e8e8e8;
}

.phone-context-menu-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.phone-context-menu-item span {
    flex: 1;
}

/* ============ ПРОСМОТР ФОТО (Photo Viewer) ============ */
.photo-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.photo-viewer-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #1a1a1a;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.photo-viewer-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-viewer-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.photo-viewer-prev,
.photo-viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    width: 50px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-viewer-prev:hover,
.photo-viewer-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

.photo-viewer-prev {
    left: 0;
    border-radius: 0 8px 8px 0;
}

.photo-viewer-next {
    right: 0;
    border-radius: 8px 0 0 8px;
}

.photo-viewer-prev:disabled,
.photo-viewer-next:disabled {
    opacity: 0.3;
    cursor: default;
}

.photo-viewer-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.photo-viewer-main img {
    max-width: 70vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
}

.photo-viewer-info {
    margin-top: 16px;
    padding: 12px;
    background: #2a2a2a;
    border-radius: 8px;
    width: 100%;
    color: #dddddd;
    max-height: 30vh;
    overflow-y: auto;
}

.photo-viewer-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 12px;
    flex-wrap: wrap;
}

.photo-viewer-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.photo-viewer-comment {
    margin-top: 8px;
}

.photo-viewer-comment label {
    font-size: 12px;
    color: #999999;
    margin-bottom: 4px;
    display: block;
}

.photo-viewer-comment .comment-text {
    background: #333333;
    padding: 8px;
    border-radius: 6px;
    font-size: 13px;
    margin: 4px 0;
    word-break: break-word;
}

.photo-viewer-comment .comment-edit {
    width: 100%;
    padding: 10px;
    border: 1px solid #dddddd;
    border-radius: 8px;
    background: #ffffff;
    color: #333333;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.photo-viewer-comment .comment-edit:focus {
    outline: none;
    border-color: #667eea;
}

.photo-viewer-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.edit-comment-btn {
    background: #444444;
    border: none;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    flex: 1;
    justify-content: center;
}

.edit-comment-btn:hover {
    background: #555555;
}

.photo-viewer-delete {
    background: #dc3545;
    border: none;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    flex: 1;
    justify-content: center;
}

.photo-viewer-delete:hover {
    background: #c82333;
}

.save-comment-btn {
    background: #2ecc71 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: background 0.2s !important;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.save-comment-btn:hover {
    background: #27ae60 !important;
}

.cancel-edit-btn {
    background: #95a5a6 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 16px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    transition: background 0.2s !important;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cancel-edit-btn:hover {
    background: #7f8c8d !important;
}

/* ============ ПУБЛИЧНАЯ СТРАНИЦА ============ */
.client-page-container {
    max-width: 800px;
    margin: 40px auto;
    background: #ffffff;
    border: 1px solid #eeeeee;
    padding: 32px;
    border-radius: 24px;
}

.client-header {
    text-align: center;
    margin-bottom: 24px;
}

.client-page-photo {
    width: 100%;
    height: 350px;
    border-radius: 16px;
    object-fit: cover;
    margin-bottom: 16px;
    border: 3px solid #eeeeee;
    animation: fadeIn 0.5s ease-in-out;
    background: #f5f5f5;
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.client-page-name {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.client-info-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.client-page-details {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: #555555;
}

.client-page-details span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.client-page-contraindications {
    font-size: 14px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dddddd;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* Карточка косметолога */
.cosmetologist-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    color: #ffffff;
}

.cosmetologist-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cosmetologist-avatar-small {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    background: #ffffff;
    flex-shrink: 0;
    display: block;
}

.cosmetologist-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cosmetologist-phone-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin-bottom: 6px;
}

.cosmetologist-phone-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.cosmetologist-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.85;
    margin-bottom: 4px;
}

.cosmetologist-buttons {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.cosmetologist-phone-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    margin-top: 12px;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

.cosmetologist-phone-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.booking-btn {
    background: #2ecc71;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 12px;
    transition: background 0.3s, transform 0.1s;
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

.booking-btn:hover {
    background: #27ae60;
    transform: translateY(-1px);
}

/* Группы задач */
.task-group {
    margin-bottom: 20px;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #eeeeee;
}

.task-group-title {
    font-size: 13px;
    font-weight: 600;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #eeeeee;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-item.service-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    cursor: pointer;
}

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

.task-item.service-item:hover {
    background: #fafafa;
}

.task-group[style*="background: #fff3f3"] .task-group-title {
    background: #ffebee;
    color: #dc3545;
}

.task-group[style*="background: #fff3f3"] .task-item {
    background: #fff5f5;
}

/* ============ ОЦЕНКА ЗВЁЗДАМИ ============ */
.star-rating {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
    direction: ltr;
}

.star-btn {
    font-size: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s;
    color: #dddddd;
}

.star-btn.active {
    color: #ffc107;
}

.star-btn:hover {
    transform: scale(1.1);
}

.star-rating-readonly .star-btn {
    cursor: default;
}

.star-rating-readonly .star-btn:hover {
    transform: none;
}

.current-rating {
    text-align: center;
    font-size: 13px;
    color: #666666;
    margin-top: 8px;
}

/* ============ ВКЛАДКИ ============ */
.profile-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
    overflow-x: auto;
    overflow-y: visible;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 0 0 8px 0;
    min-height: 48px;
    flex-shrink: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none !important;
}

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

/* ============ КЛИНИКИ ============ */
.clinic-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    border: 1px solid #eeeeee;
}

.clinic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.clinic-card.active {
    border-left: 4px solid #2ecc71;
    background: #f8fff8;
}

.clinic-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.clinic-logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    background: #f0f0f0;
}

.clinic-info {
    flex: 1;
}

.clinic-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.clinic-roles {
    font-size: 12px;
    color: #666666;
}

.clinic-address {
    font-size: 11px;
    color: #888888;
    margin-top: 4px;
}

.active-badge {
    background: #2ecc71;
    color: #ffffff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    align-self: flex-start;
}

.clinic-card-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}

.clinic-card-actions button {
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.select-clinic-btn {
    background: #e0e0e0;
    color: #333333;
}

.select-clinic-btn:hover {
    background: #d0d0d0;
}

.manage-clinic-btn {
    background: #667eea;
    color: #ffffff;
}

.manage-clinic-btn:hover {
    background: #5a67d8;
}

.member-item {
    transition: background 0.2s;
    border-radius: 12px;
}

.member-item:hover {
    background: #fafafa;
}

.member-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.member-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.member-avatar i {
    font-size: 36px;
    color: #cccccc;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 16px;
    transition: background 0.2s;
}

.member-card:hover {
    background: #f0f2f5;
}

.member-info {
    flex: 1;
}

.member-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.member-roles {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.role-badge {
    background: #e0e7ff;
    color: #4338ca;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
}

.member-actions {
    display: flex;
    gap: 8px;
}

.member-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    color: #666666;
    transition: color 0.2s;
}

.member-actions button:hover {
    color: #667eea;
}

.archive-member-btn:hover,
.leave-clinic-btn:hover {
    color: #dc3545 !important;
}

/* ============ ФОРМЫ АВТОРИЗАЦИИ ============ */
#authScreen input[type="text"],
#authScreen input[type="password"],
#authScreen input[type="tel"],
#authScreen input[type="email"] {
    width: 100%;
    padding: 14px;
    border: 1px solid #dddddd;
    border-radius: 12px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    margin-bottom: 12px;
}

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

#authScreen button {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

#authScreen button:hover {
    opacity: 0.8;
}

#authScreen .error-message {
    background: #fee;
    color: #c00;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

/* ============ МОДАЛЬНОЕ ОКНО АВТОРИЗАЦИИ ============ */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-content {
    background: #ffffff;
    max-width: 480px;
    width: 100%;
    margin: 20px;
    padding: 30px 24px 24px;
    position: relative;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 95vh;
    overflow-y: auto;
}

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999999;
    transition: color 0.2s;
    line-height: 1;
    padding: 4px 8px;
}

.auth-modal-close:hover {
    color: #333333;
}

.auth-modal-logo {
    text-align: center;
    margin-bottom: 16px;
}

.auth-modal-logo img {
    height: 50px;
    width: auto;
    max-width: 100%;
}

.auth-modal-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-modal-error {
    display: none;
    background: #fee;
    color: #c00;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid #fcc;
}

.auth-modal-input {
    width: 100%;
    padding: 14px;
    border: 1px solid #dddddd;
    border-radius: 12px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #ffffff;
    margin-bottom: 12px;
}

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

.auth-modal-input-wrapper {
    position: relative;
}

.auth-modal-input-wrapper .auth-modal-input {
    padding-right: 44px;
}

.auth-modal-toggle-password {
    position: absolute;
    right: 12px;
    top: 45%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999999;
    font-size: 18px;
    padding: 4px 8px;
    line-height: 1;
    z-index: 2;
    transition: color 0.2s;
}

.auth-modal-toggle-password:hover {
    color: #333333;
}

.auth-modal-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.auth-modal-btn-primary {
    background: #000000;
    color: #ffffff;
}

.auth-modal-btn-primary:hover {
    opacity: 0.8;
}

.auth-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-size: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-modal-footer p {
    margin: 0;
}

.auth-modal-switch {
    color: #000000;
    text-decoration: underline;
    cursor: pointer;
}

.auth-modal-switch:hover {
    color: #667eea;
}

.auth-modal-forgot {
    color: #667eea;
    text-decoration: underline;
    font-size: 14px;
}

.auth-modal-forgot:hover {
    color: #5a67d8;
}

.auth-modal-checklist {
    list-style: none;
    padding: 0;
    margin: 8px 0 12px;
    font-size: 13px;
}

.auth-modal-checklist li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    color: #999999;
    transition: color 0.3s;
}

.auth-modal-checklist li.met {
    color: #2ecc71;
}

.auth-modal-checklist li i {
    width: 18px;
    font-size: 14px;
}

.auth-modal-match-message {
    font-size: 12px;
    margin-top: 4px;
    min-height: 18px;
    transition: color 0.2s;
}

/* ============ ГАЛЕРЕЯ ФОТО (ВСЕ ФОТО) ============ */
.photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    max-height: 55vh;
    overflow-y: auto;
    padding: 4px;
}

.photo-gallery-item {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1/1;
    position: relative;
    transition: transform 0.2s;
}

.photo-gallery-item:hover {
    transform: scale(1.02);
}

.photo-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-gallery-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.photo-gallery-pagination button {
    background: #ffffff;
    border: 1px solid #dddddd;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.photo-gallery-pagination button.active {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

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

.photo-gallery-pagination button:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: #cccccc;
}

.photo-gallery-pagination .page-dots {
    padding: 8px 4px;
    color: #999999;
}

/* ============ ГЛОБАЛЬНЫЙ ЛОАДЕР ============ */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999 !important;
    flex-direction: column;
    gap: 20px;
    color: #ffffff;
    font-size: 18px;
}

.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;
}

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

/* ============ ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ============ */
.client-photo-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.client-photo-preview i {
    font-size: 40px;
    color: #cccccc;
}

.client-info-card-modal {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.client-info-card-modal .modal-client-header {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.client-info-card-modal .client-photo-col {
    flex-shrink: 0;
}

.client-info-card-modal .client-photo-col img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    background: #f5f5f5;
}

.client-info-card-modal .client-details-col {
    flex: 1;
    min-width: 200px;
}

.client-info-card-modal .details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 20px;
}

.client-info-card-modal .detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555555;
    padding: 4px 0;
}

.client-info-card-modal .detail-item i {
    width: 18px;
    color: #999999;
    font-size: 14px;
}

.client-info-card-modal .client-extra-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

/* ============ SERVICES LIST MODAL ============ */
.services-list-modal .services-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eeeeee;
}

.services-list-modal .services-list-header h2 {
    margin: 0;
    font-size: 22px;
}

.services-list-modal .close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999999;
    transition: color 0.2s;
}

.services-list-modal .close-modal-btn:hover {
    color: #333333;
}

.services-list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.services-search {
    flex: 2;
    min-width: 200px;
    position: relative;
}

.services-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999999;
}

.services-search input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 1px solid #dddddd;
    border-radius: 8px;
    font-size: 14px;
}

.services-search input:focus {
    outline: none;
    border-color: #667eea;
}

.services-sort {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sort-label {
    font-size: 13px;
    color: #666666;
}

.services-sort select {
    padding: 8px 12px;
    border: 1px solid #dddddd;
    border-radius: 8px;
    font-size: 13px;
    background: #ffffff;
    cursor: pointer;
}

.services-stats {
    font-size: 13px;
    color: #666666;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.services-list-container {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 20px;
}

.services-list-item {
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.services-list-item:hover {
    background: #fafafa;
    border-color: #dddddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.services-list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.services-list-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.services-list-item-name strong {
    font-size: 16px;
    color: #333333;
}

.services-list-item-date {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.services-list-item-date.future {
    background: #e8f5e9;
    color: #2ecc71;
}

.services-list-item-date.past {
    background: #f5f5f5;
    color: #888888;
}

.services-list-item-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.service-desc {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #888888;
    font-size: 13px;
}

.service-price-badge {
    background: #e8f5e9;
    color: #2ecc71;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.service-photos-indicator {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.recurring-badge {
    background: #fff3e0;
    color: #e65100;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.app-badge {
    background: linear-gradient(135deg, #667eea20, #764ba220);
    color: #667eea;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
}

.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.services-list-item-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.btn-edit-service {
    background: #2a2a2a;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s;
}

.btn-edit-service:hover {
    background: #111111;
}

.btn-view-rating {
    background: #f0f0f0;
    color: #333333;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-view-rating:hover {
    background: #e0e0e0;
}

.services-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.services-pagination .page-btn {
    background: #ffffff;
    border: 1px solid #dddddd;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.services-pagination .page-btn:hover:not(:disabled) {
    background: #f0f0f0;
    border-color: #cccccc;
}

.services-pagination .page-btn.active {
    background: #667eea;
    color: #ffffff;
    border-color: #667eea;
}

.services-pagination .page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.services-pagination .page-dots {
    padding: 0 8px;
    color: #999999;
}

.empty-services {
    text-align: center;
    padding: 60px 20px;
    color: #999999;
}

.empty-services i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

/* ============ COOKIE CONSENT ============ */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    color: #ffffff;
    padding: 16px 24px;
    z-index: 10002;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    transition: transform 0.3s ease;
}

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

.cookie-consent-content p {
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-consent-content p i {
    font-size: 20px;
    color: #f39c12;
}

.cookie-consent-btn {
    background: #667eea;
    color: #ffffff;
    border: none;
    padding: 8px 24px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.cookie-consent-btn:hover {
    background: #5a67d8;
}

/* ============ ТОСТЫ ============ */
.notification-toast {
    position: fixed;
    top: 70px;
    right: 20px;
    background: #f39c12;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    z-index: 10001;
    font-size: 14px;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    animation: slideInRight 0.3s ease;
}

.notification-toast.error {
    background: #dc3545;
}

.notification-toast.warning {
    background: #f39c12;
}

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

/* ============ РАЗНОЕ ============ */
.error-message {
    background: #fee;
    color: #c00;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.launch-app-btn {
    background: #2a2a2a;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    transition: opacity 0.2s;
}

.launch-app-btn:hover {
    opacity: 0.8;
}

.launch-app-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-questionnaire {
    background: #667eea;
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-questionnaire:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eeeeee;
}

.section-header .section-icon {
    font-size: 24px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333333;
}

.upload-photo-mini {
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.upload-photo-mini:hover {
    background: rgba(0, 0, 0, 0.8);
}

#bigUploadOverlay {
    transition: opacity 0.2s;
}

#bigUploadBtn {
    transition: transform 0.2s;
}

#bigUploadBtn:hover {
    transform: scale(1.02);
    background: #5a67d8;
}

/* Чекбоксы в модальных окнах */
.modal-overlay .modal-content input[type="checkbox"] {
    appearance: checkbox !important;
    -webkit-appearance: checkbox !important;
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    cursor: pointer !important;
    accent-color: #667eea;
    flex-shrink: 0;
}

.canvas-area {
    aspect-ratio: 4 / 3;
    max-height: 100%;
}

/* ============ ФОТО В ДЕТАЛЯХ ПРОЦЕДУРЫ ============ */
.photo-block {
    margin-bottom: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px;
}

.photo-block-title {
    font-size: 13px;
    font-weight: 600;
    color: #555555;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.photo-block-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.photo-block-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    background: #f0f0f0;
    flex-shrink: 0;
}

.photo-block-item:hover {
    border-color: #667eea;
    transform: scale(1.02);
}

.photo-block-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-block-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 10px;
    text-align: center;
    padding: 3px 0;
    backdrop-filter: blur(2px);
}

.photos-group {
    margin: 16px 0;
}

/* ============ ПАГИНАЦИЯ КОНТЕЙНЕР ============ */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-prev,
.page-next,
.page-num {
    padding: 8px 12px;
    border: 1px solid #dddddd;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333333;
}

.page-prev:disabled,
.page-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-num.active {
    background: #667eea;
    color: #ffffff;
    border-color: #667eea;
}

.page-dots {
    padding: 8px 4px;
    color: #888888;
}

/* ============ КНОПКИ В МОДАЛЬНОМ ОКНЕ ПОЛНОЙ ИНФОРМАЦИИ ============ */
#fullAddPhotoBtn,
#fullViewAllPhotosBtn {
    flex: 1;
    background: #2a2a2a;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
}

#fullAddPhotoBtn:hover,
#fullViewAllPhotosBtn:hover {
    opacity: 0.8;
}

#fullViewAllPhotosBtn {
    background: #e0e0e0;
    color: #333333;
}

#fullViewAllPhotosBtn:hover {
    background: #d0d0d0;
}

#fullAddProcBtn,
#fullAddCareBtn {
    flex: 1;
    background: #2a2a2a;
    color: #ffffff;
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
}

#fullAddProcBtn:hover,
#fullAddCareBtn:hover {
    opacity: 0.8;
}

#fullShareBtn,
#showStatsBtn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
    border: none;
}

#fullShareBtn {
    background: #e0e0e0;
    color: #333333;
}

#fullShareBtn:hover {
    background: #d0d0d0;
}

#showStatsBtn {
    background: #667eea;
    color: #ffffff;
}

#showStatsBtn:hover {
    background: #5a67d8;
}

/* ============ МОДАЛЬНОЕ ОКНО КЛИНИК (ОБНОВЛЁННЫЙ ДИЗАЙН) ============ */
.clinics-modal .clinics-modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.clinic-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.clinic-tab {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.clinic-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.pending-invite-card {
    background: #fffaf0;
    border: 1px solid #ffe0b3;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
}

.pending-invite-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.pending-invite-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.respond-invite-btn {
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.respond-invite-btn.accept {
    background: #2ecc71;
    color: #ffffff;
}

.respond-invite-btn.decline {
    background: #dc3545;
    color: #ffffff;
}

.members-section {
    margin-bottom: 24px;
}

.invite-member-btn {
    background: #667eea;
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    cursor: pointer;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.invite-meta {
    font-size: 11px;
    color: #888888;
    margin-top: 4px;
}

.empty-members {
    text-align: center;
    padding: 30px;
    color: #999999;
}

.modal-content .photo-buttons-row,
.modal-content .service-buttons-row,
.modal-content .link-stats-row {
    display: flex;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.modal-content .photo-buttons-row button,
.modal-content .service-buttons-row button,
.modal-content .link-stats-row button {
    flex: 1;
    background: #2a2a2a;
    color: #ffffff;
    border: none;
    padding: 12px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: opacity 0.2s;
}

.modal-content .photo-buttons-row button:hover,
.modal-content .service-buttons-row button:hover,
.modal-content .link-stats-row button:hover {
    opacity: 0.9;
}

.modal-content .photo-buttons-row .btn-view-all-photos,
.modal-content .link-stats-row .btn-share {
    background: #e0e0e0;
    color: #111111;
}

.modal-content .photo-buttons-row .btn-view-all-photos:hover,
.modal-content .link-stats-row .btn-share:hover {
    background: #d0d0d0;
}

.modal-content .link-stats-row .btn-stats {
    background: #667eea;
    color: #ffffff;
}

.modal-content .link-stats-row .btn-stats:hover {
    background: #5a67d8;
}

/* ============ РЕФЕРАЛЬНАЯ СИСТЕМА ============ */
.referral-stats {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    padding: 20px;
    color: #ffffff;
    margin: 16px 24px;
}

.referral-link-box {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.referral-link-box input {
    flex: 2;
    min-width: 200px;
    padding: 12px;
    background: #f5f5f5;
    border: 1px solid #dddddd;
    border-radius: 12px;
    font-size: 13px;
    font-family: monospace;
}

.btn-share {
    background: #e0e0e0;
    color: #111111;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.btn-share:hover {
    background: #d0d0d0;
    transform: translateY(-1px);
}

.referral-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.referral-card:hover {
    background: #fafafa;
}

.referral-avatar {
    flex-shrink: 0;
}

.referral-avatar i {
    font-size: 44px;
    color: #cccccc;
}

.empty-referrals {
    text-align: center;
    padding: 30px;
    color: #999999;
}

.empty-referrals i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

/* ============================================================
   МЕДИА-ЗАПРОСЫ (все собраны в одном месте)
   ============================================================ */

/* Планшеты */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .header {
        padding: 10px 16px;
        gap: 10px;
    }

    .user-name span {
        display: none;
    }

    .btn-logout span {
        display: none;
    }

    .btn-logout {
        padding: 8px 12px;
    }

    .btn-logout i {
        margin: 0;
    }

    .user-avatar-wrapper {
        width: 32px;
        height: 32px;
    }

    .notification-bell {
        font-size: 16px;
    }

    .btn-clinic {
        padding: 4px 12px;
        font-size: 12px;
    }

    .clinic-name-truncate {
        max-width: 140px;
    }

    .clients-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .client-details-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px 12px;
    }

    .card-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .card-buttons .btn-card {
        width: calc(50% - 5px);
        flex: none;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
    }

    .modal-content h2 {
        font-size: 18px;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .modal-buttons button {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 16px;
    }

    .inline-fields {
        flex-direction: column;
        gap: 12px;
    }

    .service-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 0;
        gap: 6px;
    }

    .service-name {
        width: 100%;
        font-size: 15px;
    }

    .service-date {
        white-space: normal;
        font-size: 12px;
        display: flex;
        align-items: center;
        gap: 6px;
        color: #666666;
    }

    .photo-album-grid {
        gap: 8px;
    }

    .photo-gallery-grid {
        max-height: 55vh !important;
        overflow-y: auto !important;
    }

    .notification-dropdown {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
    }

    .referral-stats {
        margin: 12px 16px;
        padding: 16px;
    }

    .btn-share {
        justify-content: center;
    }

    .tariff-comparison {
        flex-direction: column;
    }

    .profile-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 8px;
    }

    .profile-tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        flex: 0 0 auto;
        text-align: center;
        padding: 10px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .action-bar {
        flex-direction: column;
    }

    .btn-find,
    .btn-add {
        width: 100%;
        justify-content: center;
    }

    .pagination button {
        padding: 8px 14px;
        font-size: 12px;
        border-radius: 6px;
    }

    .toggle-all-btn {
        padding: 6px 12px;
        font-size: 10px;
        border-radius: 4px;
    }

    .settings-header h3 {
        font-size: 14px;
    }

    .client-page-photo {
        height: 250px;
        border-radius: 12px;
    }

    .cookie-consent {
        padding: 12px 16px;
    }

    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-consent-content p {
        justify-content: center;
    }

    .services-list-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .services-sort {
        justify-content: space-between;
    }

    .services-list-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .services-list-item-details {
        flex-direction: column;
        align-items: flex-start;
    }

    .services-list-item-actions {
        flex-direction: column;
    }

    .services-list-item-actions .btn-edit-service,
    .services-list-item-actions .btn-view-rating {
        width: 100%;
        justify-content: center;
    }

    .clinic-phones a[href^="tel:"] {
        font-size: 16px;
        padding: 6px 12px;
    }

    .modal-content .photo-buttons-row,
    .modal-content .service-buttons-row,
    .modal-content .link-stats-row {

    }

    .client-info-card-modal .details-grid {

    }
}

/* Телефоны */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .header {
        padding: 8px 12px;
    }

    .logo {
        font-size: 20px;
    }

    .user-avatar-wrapper {
        width: 28px;
        height: 28px;
    }

    .btn-logout {
        padding: 6px 8px;
    }

    .btn-logout i {
        font-size: 14px;
    }

    .btn-clinic {
        font-size: 11px;
        padding: 4px 8px;
    }

    .client-name {
        font-size: 16px;
    }

    .client-page-name {
        font-size: 20px;
    }

    .card-content {
        padding: 14px;
    }

    .multi-photo-item,
    .multi-photo-add {
        width: 80px;
        height: 80px;
    }

    .multi-photo-add-icon {
        font-size: 20px;
    }

    .multi-photo-add-text {
        font-size: 9px;
    }

    .multi-photo-view,
    .multi-photo-delete {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .profile-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        gap: 4px;
        padding-bottom: 8px;
        margin-bottom: 16px;
    }

    .profile-tabs::-webkit-scrollbar {
        height: 3px;
    }

    .profile-tabs::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 10px;
    }

    .profile-tabs::-webkit-scrollbar-thumb {
        background: #cbd5e0;
        border-radius: 10px;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 12px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .client-page-photo {
        height: 200px;
        border-radius: 10px;
        border-width: 2px;
    }

    .auth-modal-content {
        padding: 20px 16px 16px;
        margin: 10px;
    }

    .auth-modal-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .auth-modal-input {
        padding: 12px;
        font-size: 16px;
    }

    .auth-modal-toggle-password {
        right: 8px;
        font-size: 20px;
    }

    .auth-modal-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .referral-link-box {
        flex-direction: column;
        align-items: stretch;
    }

    .referral-link-box input,
    .referral-link-box .btn-share {
        width: 100%;
    }

    .client-info-card-modal .modal-client-header {
        align-items: center;
        text-align: center;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .client-page-photo {
        height: 160px;
        border-radius: 8px;
    }
}

/* ============================================================
   CLS FIX - резервирование места для стабильной загрузки
   ============================================================ */

#appRoot {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#mainApp {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 80vh;
}

.header {
    min-height: 70px;
    flex-shrink: 0;
}

footer {
    min-height: 120px;
    margin-top: 40px;
    contain: layout;
    transition: none;
}

.settings-panel {
    contain: layout;
    transition: none;
}

#clientsGrid {
    min-height: 400px;
}

.clients-grid-loading {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    min-height: 400px;
}

.clients-grid-loading .skeleton-card {
    background: #f0f0f0;
    border-radius: 16px;
    aspect-ratio: 1/1;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============ ТЕЛЕФОНЫ НА ПУБЛИЧНОЙ СТРАНИЦЕ ============ */
.clinic-phones a[href^="tel:"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
}

.clinic-phones a[href^="tel:"]:active {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: scale(0.98);
}