/* Общие стили для системы "Табель Боровково" */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
}

/* Навигационная панель */
.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.nav-link {
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Карточки статистики */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

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

/* Табличный интерфейс */
.timesheet-table {
    font-size: 0.9rem;
    background: white;
}

.timesheet-table th {
    background-color: var(--light-color);
    font-weight: 600;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #dee2e6;
}

.timesheet-table .employee-name {
    background-color: var(--light-color);
    font-weight: 600;
    position: sticky;
    left: 0;
    z-index: 5;
    min-width: 200px;
    max-width: 200px;
}

.timesheet-table .day-header {
    min-width: 40px;
    max-width: 40px;
    font-size: 0.8rem;
}

.timesheet-table .weekday {
    font-size: 0.7rem;
    color: #6c757d;
}

/* Ячейки табеля */
.time-cell {
    width: 40px;
    height: 40px;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: 1px solid #dee2e6;
    position: relative;
}

.time-cell:hover {
    background-color: #e3f2fd;
}

.time-cell.weekend {
    background-color: #f8f9fa;
    color: #6c757d;
}

.time-cell.planned {
    background-color: #fff;
}

.time-cell.on-schedule {
    background-color: #d4edda;
    color: #155724;
    font-weight: 600;
}

.time-cell.overtime {
    background-color: #fff3cd;
    color: #856404;
    font-weight: 600;
}

.time-cell.undertime {
    background-color: #f8d7da;
    color: #721c24;
    font-weight: 600;
}

.time-cell.extra {
    background-color: #d1ecf1;
    color: #0c5460;
    font-weight: 600;
}

/* Инлайн редактирование */
.time-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.time-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    background-color: white;
}

/* Индикаторы статуса */
.status-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.planned {
    background-color: #6c757d;
}

.status-indicator.on-schedule {
    background-color: var(--success-color);
}

.status-indicator.overtime {
    background-color: var(--warning-color);
}

.status-indicator.undertime {
    background-color: var(--danger-color);
}

.status-indicator.extra {
    background-color: var(--info-color);
}

/* Формы */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn {
    transition: all 0.2s ease;
}

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

/* Алерты */
.alert {
    border: none;
    border-radius: 8px;
}

.alert-dismissible .btn-close {
    padding: 0.75rem 0.75rem;
}

/* Таблицы */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table th {
    border-top: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Подвал */
footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* Загрузка */
.loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .timesheet-table {
        font-size: 0.8rem;
    }
    
    .time-cell {
        width: 35px;
        height: 35px;
    }
    
    .employee-name {
        min-width: 150px !important;
        max-width: 150px !important;
    }
    
    .day-header {
        min-width: 35px !important;
        max-width: 35px !important;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .timesheet-table {
        font-size: 0.75rem;
    }
    
    .time-cell {
        width: 30px;
        height: 30px;
    }
    
    .employee-name {
        min-width: 120px !important;
        max-width: 120px !important;
        font-size: 0.8rem;
    }
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 0.5s ease-in-out;
}

/* Утилитарные классы */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.border-dashed {
    border-style: dashed !important;
}

/* Печать */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .timesheet-table {
        font-size: 0.7rem;
    }
    
    .time-cell {
        border: 1px solid #000 !important;
    }
}