/* staff.css - Стили для страницы "Сотрудники" */

.staff-section {
    padding: 60px 0;
    background-color: var(--bg);
}

.page-header {
    margin-bottom: 40px;
}

.page-header h1 {
    margin-bottom: 10px;
    color: var(--text);
}

.page-header p {
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 20px;
}

/* Таблица сотрудников */
.staff-table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 30px;
}

.staff-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.staff-table th {
    background-color: var(--hover);
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.staff-table td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.staff-table tbody tr:hover {
    background-color: var(--hover);
    transition: var(--transition);
}

.staff-table tbody tr:last-child td {
    border-bottom: none;
}

/* Статусы */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-active {
    background-color: rgba(72, 187, 120, 0.1);
    color: #48bb78;
}

.status-dismissed {
    background-color: rgba(245, 101, 101, 0.1);
    color: #f56565;
}

.status-vacation {
    background-color: rgba(66, 153, 225, 0.1);
    color: #4299e1;
}

.status-absence {
    background-color: rgba(237, 137, 54, 0.1);
    color: #ed8936;
}

/* Кнопки действий */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-action {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 14px;
}

.btn-action:hover {
    background: var(--hover);
    color: var(--text);
}

.btn-card:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-dismiss:hover {
    color: #f56565;
    border-color: #f56565;
}

.btn-restore:hover {
    color: #48bb78;
    border-color: #48bb78;
}

.btn-delete:hover {
    color: #f56565;
    border-color: #f56565;
}

/* Поиск и кнопки */
.staff-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.btn {
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
}

/* Индикаторы */
.loading-indicator,
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading-indicator i,
.no-results i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 0;
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--hover);
    color: var(--danger);
}

.modal-body {
    padding: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 30px;
    border-top: 1px solid var(--border);
}

/* Форма */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
    background: var(--surface);
}

.form-text {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Контейнер для блоков ФОТ и Налогов - ФИКСИРОВАННЫЕ РАЗМЕРЫ */
.funds-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* ОБЩИЕ СТИЛИ ДЛЯ ОБОИХ БЛОКОВ - ИДЕНТИЧНЫЕ */
.salary-fund-section,
.taxes-section {
    margin: 0;
    padding: 0;
}

.salary-fund-card,
.taxes-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    height: 100%;
    min-height: 100px;
    box-sizing: border-box;
}

/* Hover эффекты */
.salary-fund-card:hover,
.taxes-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

/* ИКОНКИ - ОДИНАКОВЫЕ РАЗМЕРЫ */
.fund-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Цвета иконок */
.salary-fund-card .fund-icon {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
}

.taxes-card .fund-icon {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
}

.fund-icon i {
    font-size: 1.5rem;
    color: white;
}

/* ИНФОБЛОК - ОДИНАКОВЫЙ */
.fund-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Заголовок */
.fund-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Сумма */
.fund-amount {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Цвета сумм */
.salary-fund-card .fund-amount {
    color: var(--success);
}

.taxes-card .fund-amount {
    color: var(--warning);
}

/* ГАРАНТИРУЕМ ОДИНАКОВЫЕ РАЗМЕРЫ НА ВСЕХ ЭКРАНАХ */
@media (min-width: 769px) {
    .funds-container {
        grid-template-columns: repeat(2, minmax(0, 300px));
        justify-content: start;
    }
}

/* МОБИЛЬНАЯ ВЕРСИЯ */
@media (max-width: 768px) {
    .funds-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .salary-fund-card,
    .taxes-card {
        padding: 18px;
        min-height: 95px;
    }
    
    .fund-icon {
        width: 45px;
        height: 45px;
        min-width: 45px;
        min-height: 45px;
    }
    
    .fund-icon i {
        font-size: 1.3rem;
    }
    
    .fund-amount {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .salary-fund-card,
    .taxes-card {
        padding: 15px;
        gap: 12px;
        min-height: 85px;
    }
    
    .fund-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .fund-icon i {
        font-size: 1.1rem;
    }
    
    .fund-label {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }
    
    .fund-amount {
        font-size: 1.1rem;
    }
}

/* Стили для модального окна налогов */
.taxes-summary {
    background: var(--hover);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.total-amount {
    font-weight: 700;
    color: var(--warning);
    font-size: 1.3rem;
}

.info-row {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-row small {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.taxes-details-table {
    margin: 25px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.details-table thead {
    background-color: var(--hover);
}

.details-table tbody tr:hover {
    background-color: var(--hover);
}

.details-table tbody tr:last-child td {
    border-bottom: none;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Фиксированная ширина колонок */
}

.details-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border);
    font-size: 0.9rem;
}

.details-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

/* Первая колонка - шире */
.details-table th:first-child,
.details-table td:first-child {
    width: 60%;
}

/* Вторая колонка - уже, для суммы */
.details-table th:last-child,
.details-table td:last-child {
    width: 40%;
    text-align: right;
}

.details-table .amount {
    font-weight: 600;
    font-family: 'SF Mono', Monaco, 'Cascadia Mono', monospace;
    font-size: 1rem;
    color: var(--text);
    white-space: nowrap;
}

.details-table tfoot td {
    padding: 18px 20px;
    font-weight: 600;
    border-top: 2px solid var(--border);
    background-color: var(--hover);
}

.details-table tfoot .total-amount {
    color: var(--warning);
    font-size: 1.2rem;
}

.details-table small {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: block;
    margin-top: 4px;
}

.taxes-notes h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--info);
    display: flex;
    align-items: center;
    gap: 10px;
}

.taxes-notes ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.taxes-notes li {
    margin-bottom: 5px;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Адаптивность таблицы сотрудников */
@media (max-width: 1024px) {
    .staff-table-container {
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .staff-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .staff-table {
        min-width: 600px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
}

/* Адаптивность модального окна */
@media (max-width: 768px) {
    .details-table th,
    .details-table td {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .taxes-summary {
        padding: 15px;
    }
    
    .total-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-row small {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .details-table {
        display: block;
        overflow-x: auto;
    }
    
    .details-table th,
    .details-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

/* Стили для поля ввода денег */
.money-input {
    text-align: right;
    font-family: 'SF Mono', Monaco, 'Cascadia Mono', monospace;
    font-weight: 500;
}

.money-input::placeholder {
    text-align: left;
    font-family: inherit;
    font-weight: normal;
}