:root {
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --shadow-light: rgba(255, 255, 255, 0.7);
    --shadow-dark: rgba(163, 177, 198, 0.6);
    --accent-yellow: #ffd700;
    --accent-yellow-dark: #ffc700;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-radius: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pan-x;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-image: url('/static/fon.png');
    background-color: var(--bg-color);
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: scroll;
    color: var(--text-primary);
    padding: 12px;
    padding-top: 80px;
    padding-bottom: 10px;
    min-height: 100vh;
}

/* Убираем отступы для веб-версии (не Telegram) */
body:not(.telegram-webapp) {
    padding-top: 0 !important;
    padding-bottom: 12px;
}

/* Убираем верхние отступы для веб-версии */
body:not(.telegram-webapp) .projects-header {
    margin-top: 0 !important;
}

body:not(.telegram-webapp) .project-header {
    margin-top: 0 !important;
}
    height: auto;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pan-x;
    position: relative;
}
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 100px;
    min-height: 36px;
    box-sizing: border-box;
}

.role-selector:hover {
    border-color: var(--accent-yellow);
}

.role-selector:active {
    border-color: var(--accent-yellow-dark);
}

.role-selector:focus {
    border-color: var(--accent-yellow);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    body {
        padding: 8px;
        padding-top: 20px;
        padding-bottom: 16px;
    }
    
    .container {
        padding: 0;
    }
    
    .card {
        padding: 10px;
        margin-bottom: 10px;
        border-radius: 14px;
    }
    
    h1 {
        font-size: 22px;
        margin-bottom: 12px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    .project-name {
        font-size: 17px;
    }
    
    .project-address {
        font-size: 13px;
    }
    
    .projects-tabs {
        gap: 6px;
        margin-bottom: 12px;
    }
    
    .projects-tab {
        padding: 10px 12px;
        font-size: 15px;
    }
    
    .role-selector-container {
        top: 8px;
        right: 8px;
    }
    
    .role-selector {
        font-size: 12px;
        padding: 6px 28px 6px 10px;
        min-width: 90px;
        min-height: 32px;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .section-title {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .financial-info {
        gap: 10px;
    }
    
    .financial-item {
        padding: 10px;
    }
    
    .financial-label {
        font-size: 12px;
    }
    
    .financial-value {
        font-size: 16px;
    }
    
    .photos-grid {
        gap: 6px;
    }
    
    .document-item {
        padding: 10px;
    }
    
    .document-name {
        font-size: 14px;
    }
    
    .form-group {
        margin-bottom: 14px;
    }
    
    .form-label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-input, .form-select {
        padding: 10px;
        font-size: 16px;
    }
    
    /* Модальные окна */
    .modal-content {
        padding: 12px;
        margin-top: 50px;
        margin-bottom: 20px;
    }
    
    .modal-close {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .modal-media-content {
        padding: 16px;
        border-radius: 14px;
    }
    
    .modal-image, .modal-video {
        margin-bottom: 12px;
        border-radius: 12px;
    }
    
    .modal-date-filter-bar {
        padding: 12px;
    }
    
    .modal-date-filter-bar .date-filter-btn,
    .date-filter-btn {
        padding: 10px 16px !important;
        font-size: 14px !important;
        min-width: 120px !important;
    }
    
    .modal-date-filter-bar .date-filter-btn > div:first-child,
    .date-filter-btn > div:first-child {
        font-size: 14px !important;
    }
    
    .modal-date-filter-bar .date-filter-btn > div:last-child,
    .date-filter-btn > div:last-child {
        font-size: 12px !important;
    }
    
    .modal-date-filter-container {
        gap: 8px;
    }
    
    .foreman-item {
        padding: 14px;
    }
    
    .foreman-name {
        font-size: 16px;
    }
    
    .foreman-username {
        font-size: 13px;
    }
    
    /* Уведомления */
    .notification {
        top: 60px;
        left: 12px;
        right: 12px;
        transform: translateX(0) translateY(-100px);
        padding: 12px 16px;
        font-size: 14px;
    }
    
    /* Лоадер */
    .loader {
        width: 32px;
        height: 32px;
        border-width: 3px;
        margin: 16px auto;
    }
    
    .loading-overlay .loader {
        width: 50px;
        height: 50px;
        border-width: 5px;
    }
    
    /* Утилиты */
    .mt-20 {
        margin-top: 12px;
    }
    
    .mb-20 {
        margin-bottom: 12px;
    }
    
    /* Исправление наложений */
    .project-card {
        position: relative;
        overflow: visible;
    }
    
    .delete-project-btn {
        position: absolute !important;
        top: 8px !important;
        right: 8px !important;
        z-index: 10 !important;
    }
    
    /* Фиксированные элементы не должны накладываться */
    * {
        box-sizing: border-box;
    }
    
    /* Улучшение читаемости текста на мобильных */
    p, span, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Улучшение тач-таргетов */
    button, a, input[type="button"], input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Фиксация проблем со скроллом */
    html {
        height: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    body {
        overflow-x: hidden;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y pan-x;
        height: auto !important;
        position: relative !important;
    }
    
    .container {
        overflow-x: hidden;
        overflow-y: visible !important;
        touch-action: pan-y pan-x;
        height: auto !important;
    }
    
    #main-content {
        overflow-y: visible !important;
        height: auto !important;
    }
}

.container {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    padding: 0;
    touch-action: pan-y pan-x;
    -webkit-overflow-scrolling: touch;
    overflow-y: visible;
    height: auto;
}

#main-content {
    touch-action: pan-y pan-x;
    -webkit-overflow-scrolling: touch;
    overflow-y: visible;
    height: auto;
    min-height: 100vh;
}

/* Карточка */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.card:hover {
    border-color: var(--accent-yellow);
}

.card-pressed {
    border-color: var(--accent-yellow-dark);
}

/* Кнопки */
.btn {
    background: var(--card-bg);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover {
    border-color: var(--accent-yellow);
}

.btn:active {
    border-color: var(--accent-yellow-dark);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-yellow) 0%, var(--accent-yellow-dark) 100%);
    color: #131313;
    border: 2px solid var(--accent-yellow-dark);
}

.btn-primary:hover {
    border-color: var(--accent-yellow);
}

.btn-primary:active {
    border-color: var(--accent-yellow-dark);
    opacity: 0.9;
}

/* Иконки в желтых кнопках должны быть темно-серыми (#131313) */
.btn-primary .icon,
.btn[style*="accent-yellow"] .icon,
button[style*="accent-yellow"] .icon {
    filter: none;
    color: #131313 !important;
    -webkit-text-fill-color: #131313;
}

.btn-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) saturate(100%) invert(88%) sepia(98%) saturate(1493%) hue-rotate(324deg) brightness(105%) contrast(101%);
}

/* Иконки */
.icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    filter: brightness(0) saturate(100%) invert(88%) sepia(98%) saturate(1493%) hue-rotate(324deg) brightness(105%) contrast(101%);
}

.icon-small {
    width: 18px;
    height: 18px;
}

/* Заголовки */
h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    margin-top: 0;
    color: var(--text-primary);
    line-height: 1.2;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 0;
    color: var(--text-primary);
    line-height: 1.3;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    margin-top: 0;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Заголовок проектов */
.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    margin-top: 70px;
    gap: 12px;
}

.projects-header h1 {
    margin: 0;
    flex: 1;
}

/* Убираем верхние отступы для веб-версии */
body:not(.telegram-webapp) .projects-header {
    margin-top: 0 !important;
}

body:not(.telegram-webapp) .project-header {
    margin-top: 0 !important;
}

/* Вкладки проектов */
.projects-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0;
}

.projects-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin-bottom: -2px;
}

.projects-tab:hover {
    color: var(--text-primary);
}

.projects-tab.active {
    color: var(--accent-yellow-dark);
    border-bottom-color: var(--accent-yellow-dark);
}

/* Список проектов */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.project-image {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 16px;
    border: 2px solid #e0e0e0;
}

.project-image-placeholder {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 48px;
    border: 2px solid #e0e0e0;
}

.project-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
    padding-right: 40px;
}

.project-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.project-address {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    flex: 1;
    margin-bottom: 8px;
    line-height: 1.4;
    min-width: 0;
    word-wrap: break-word;
}

.project-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.project-completion {
    font-size: 14px;
    color: var(--text-secondary);
    flex: 1;
    min-width: 140px;
}

    .project-speed {
        font-size: 18px;
        font-weight: 700;
        color: var(--accent-yellow-dark);
        white-space: nowrap;
    }
    
    /* Индекс скорости в карточке */
    .project-stats div[style*="font-size: 24px"] {
        font-size: 20px !important;
    }

/* Кнопка добавления */
.add-project-btn {
    width: 100%;
    justify-content: center;
    font-size: 18px;
    padding: 20px;
    margin-top: 20px;
}

.add-project-btn .icon {
    width: 28px;
    height: 28px;
}

/* Кнопка добавления проекта в заголовке */
.add-project-header-btn {
    background: linear-gradient(135deg, var(--accent-yellow) 0%, var(--accent-yellow-dark) 100%);
    border: 2px solid var(--accent-yellow-dark);
    border-radius: 12px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #616161;
    flex-shrink: 0;
    font-size: 20px;
    -webkit-tap-highlight-color: transparent;
}

.add-project-header-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* Детали проекта */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    margin-top: 70px;
    gap: 8px;
}

.back-btn {
    background: white !important;
    color: #131313 !important;
    border: 2px solid white;
    border-radius: 12px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 20px;
    -webkit-tap-highlight-color: transparent;
}

.back-btn:hover {
    border-color: var(--accent-yellow);
}

.back-btn:active {
    border-color: var(--accent-yellow-dark);
    transform: scale(0.95);
}

.project-title {
    flex: 1;
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Секции */
.section {
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.section-title .icon {
    font-size: 20px;
    flex-shrink: 0;
}

/* Фото галерея */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    touch-action: pan-y;
}

.photo-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    transition: transform 0.2s ease;
    display: block;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.photo-thumb:active {
    transform: scale(0.95);
}

.photo-date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: center;
}

/* Финансовая информация */
.financial-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.financial-item {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.financial-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.financial-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.speed-index {
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-yellow-dark);
    text-align: center;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 15px;
    border: 2px solid #e0e0e0;
}

/* Документы */
.documents-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.document-item {
    background: var(--card-bg);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.document-item:active {
    border-color: var(--accent-yellow);
    transform: scale(0.98);
}

.document-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

/* Заметки */
.notes-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: var(--card-bg);
    font-family: inherit;
    font-size: 16px;
    color: var(--text-primary);
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.5;
}

.notes-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Убираем полупрозрачную маску для placeholder в полях ввода суммы */
.amount-input::placeholder,
.amount-input::-webkit-input-placeholder,
.amount-input::-moz-placeholder,
.amount-input:-ms-input-placeholder {
    color: transparent;
    opacity: 0;
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--accent-yellow);
}

/* Модальное окно для фото */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    background-image: url('/static/fon.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: 1000;
    padding: 0;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#document-form-modal {
    display: none;
    background-image: url('/static/fon.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

#document-form-modal.active {
    display: flex;
}

.modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1002;
}

.modal-close:hover {
    background: #ff4444;
    border-color: #ff4444;
    color: white;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(255, 68, 68, 0.4);
}

.modal-content {
    max-width: 100%;
    width: 100%;
    padding: 20px;
    margin-top: 90px;
    margin-bottom: 40px;
    background: transparent;
    min-height: calc(100vh - 120px);
}

/* Убираем верхние отступы для веб-версии */
body:not(.telegram-webapp) .modal-content {
    margin-top: 0 !important;
}

.document-modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.media-carousel-container {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overflow-y: scroll;
    overflow-x: hidden;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.media-carousel-item {
    scroll-snap-align: center;
    scroll-snap-stop: always;
    flex-shrink: 0;
}

.modal-media-content {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
}

.modal-image {
    max-width: 100%;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #fafafa;
    padding: 8px;
    cursor: pointer;
    display: block;
}

.modal-image:hover {
    transform: scale(1.01);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-video {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #fafafa;
    display: block;
}

/* Панель фильтров по датам */
.modal-date-filter-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    padding: 20px;
    z-index: 1001;
    border-bottom: 2px solid #e0e0e0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.modal-date-filter-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
}

.modal-date-filter-container::-webkit-scrollbar {
    height: 6px;
}

.modal-date-filter-container::-webkit-scrollbar-track {
    background: transparent;
}

.modal-date-filter-container::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
}

.modal-date-filter-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* Кнопки фильтрации по датам */
.modal-date-filter-bar .date-filter-btn,
.date-filter-btn {
    padding: 14px 24px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 15px !important;
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
    min-width: 140px;
    box-shadow: none !important;
    margin: 0 !important;
}

.modal-date-filter-bar .date-filter-btn:hover,
.date-filter-btn:hover {
    border-color: var(--accent-yellow) !important;
}

.modal-date-filter-bar .date-filter-btn:active,
.date-filter-btn:active {
    border-color: var(--accent-yellow-dark) !important;
}

.modal-date-filter-bar .date-filter-btn.active,
.date-filter-btn.active {
    background: linear-gradient(135deg, var(--accent-yellow) 0%, var(--accent-yellow-dark) 100%) !important;
    border-color: var(--accent-yellow-dark) !important;
    color: #616161 !important;
}

.modal-date-filter-bar .date-filter-btn.active:hover,
.date-filter-btn.active:hover {
    border-color: var(--accent-yellow) !important;
}

.modal-date-filter-bar .date-filter-btn.active:active,
.date-filter-btn.active:active {
    border-color: var(--accent-yellow-dark) !important;
    opacity: 0.9;
}

/* Стили для внутренних div в кнопках */
.modal-date-filter-bar .date-filter-btn > div:first-child,
.date-filter-btn > div:first-child {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: inherit !important;
    margin: 0 !important;
}

.modal-date-filter-bar .date-filter-btn.active > div:first-child,
.date-filter-btn.active > div:first-child {
    color: #616161 !important;
}

.modal-date-filter-bar .date-filter-btn > div:last-child,
.date-filter-btn > div:last-child {
    font-size: 14px !important;
    opacity: 0.85 !important;
    font-weight: 500 !important;
    color: inherit !important;
    margin: 0 !important;
}

.modal-date-filter-bar .date-filter-btn.active > div:last-child,
.date-filter-btn.active > div:last-child {
    color: #616161 !important;
    opacity: 0.85 !important;
}

/* Выбор прораба */
.foremen-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.foreman-item {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    transition: all 0.2s ease;
}

.foreman-item:hover {
    border-color: var(--accent-yellow);
}

.foreman-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.foreman-username {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Форма создания проекта */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: var(--card-bg);
    font-family: inherit;
    font-size: 16px;
    color: var(--text-primary);
    box-sizing: border-box;
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-yellow);
}

.form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: var(--card-bg);
    font-family: inherit;
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
    box-sizing: border-box;
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-yellow);
}

/* Лоадер */
.loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--shadow-dark);
    border-top-color: var(--accent-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Индикатор загрузки на кнопке */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Анимация появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Анимация успеха */
@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }
}

.success-pulse {
    animation: successPulse 0.5s ease-out;
}

/* Overlay для загрузки */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 245, 245, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay .loader {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

/* Утилиты */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.notification-error {
    background: #ff4444;
    color: white;
}

.notification-success {
    background: #4caf50;
    color: white;
}

/* Ошибки полей ввода */
.input-error {
    background: #ffebee !important;
    border: 2px solid #ff4444 !important;
    box-shadow: 
        inset 4px 4px 8px rgba(255, 68, 68, 0.2),
        inset -4px -4px 8px rgba(255, 255, 255, 0.8) !important;
}

.field-error {
    color: #ff4444;
    font-size: 14px;
    margin-top: 8px;
    font-weight: 600;
    text-align: center;
    padding: 8px;
    background: #ffebee;
    border-radius: 8px;
    border: 1px solid #ff4444;
}

