* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    padding-bottom: 70px;
    line-height: 1.5;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.header-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 13px;
    opacity: 0.95;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logout-btn:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.15);
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.btn {
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
}

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

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:active {
    opacity: 0.9;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:active {
    opacity: 0.9;
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:active {
    background: #f5f3ff;
}

.btn-small {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
}

.btn-block {
    width: 100%;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    min-height: 44px;
}

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

.form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    min-height: 44px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    padding: 16px;
    border-radius: 10px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: #666;
}

.fine-item {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    position: relative;
}

.fine-item.selected {
    background: #fee2e2;
    border-left-color: #991b1b;
}

.fine-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.fine-amount {
    font-size: 18px;
    font-weight: 700;
    color: #ef4444;
}

.fine-date {
    font-size: 12px;
    color: #999;
}

.fine-reason {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

.employee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.employee-item:active {
    background: #f3f4f6;
}

.employee-info {
    flex: 1;
}

.employee-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.employee-stats {
    font-size: 13px;
    color: #666;
}

.employee-fines {
    font-size: 18px;
    font-weight: 700;
    color: #ef4444;
}

.pvz-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.pvz-item:active {
    border-color: #667eea;
    background: #f5f3ff;
}

.pvz-name {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.pvz-employees {
    font-size: 14px;
    color: #666;
}

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
}

.tab-item.active {
    color: #667eea;
}

.tab-icon {
    font-size: 24px;
    margin-bottom: 2px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

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

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

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

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: #dbeafe;
    color: #1e40af;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.week-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.week-btn {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.week-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

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


/* ============================================================================
   Новые стили для расчета зарплаты
   ============================================================================ */

/* Расчет зарплаты */
.salary-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.salary-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.salary-item.paid {
    opacity: 0.6;
    background: #f0f9ff;
}

.salary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.salary-amount-container {
    text-align: right;
}

.salary-amount {
    font-size: 20px;
    font-weight: 700;
    color: #10b981;
    display: block;
}

.paid-badge {
    padding: 6px 12px;
    background: #d1fae5;
    color: #10b981;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
}

.salary-details {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
}

.detail-total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 2px solid #e5e7eb;
    font-size: 16px;
}

.text-danger {
    color: #ef4444;
}

/* График работы */
.schedule-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.schedule-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    gap: 12px;
}

.schedule-icon {
    font-size: 18px;
    transition: transform 0.3s;
}

.schedule-item.open .schedule-icon {
    transform: rotate(180deg);
}

.schedule-edit {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.weekdays-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.weekday-checkbox {
    padding: 10px 16px;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    user-select: none;
}

.weekday-checkbox:hover {
    background: #e5e7eb;
}

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

.weekday-checkbox input[type="checkbox"]:checked {
    accent-color: #10b981;
}

.daily-rate-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
}

/* История выплат */
.week-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.week-navigation .btn {
    flex: 1;
    min-width: 120px;
}

.payment-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.payment-amount-container {
    text-align: right;
}

.payment-amount {
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
    display: block;
}

.payment-date {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.payment-details {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: white;
    border-radius: 12px;
    margin-top: 16px;
}

.pagination-info {
    font-size: 14px;
    color: #6b7280;
}

.card-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 12px;
}

/* Дополнительные утилиты */
.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:active {
    opacity: 0.9;
}

.btn-block {
    width: 100%;
}

/* ============================================================================
   Страница "Сегодня работают" (Today Working)
   ============================================================================ */

/* Трехколоночная сетка статистики */
.stats-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

/* Кнопки массовых действий */
.bulk-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.bulk-actions .btn {
    flex: 1;
    padding: 12px;
    font-size: 14px;
}

/* Контейнер списка сотрудников */
.employees-checklist {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Элемент сотрудника с чекбоксом */
.employee-checkbox-item {
    border-bottom: 1px solid #f3f4f6;
}

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

/* Лейбл с кастомным чекбоксом */
.checkbox-label {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s;
    min-height: 56px;
}

.checkbox-label:active {
    background-color: #f9fafb;
}

/* Скрыть нативный чекбокс */
.employee-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Кастомный индикатор чекбокса */
.checkbox-indicator {
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s;
    background: white;
}

/* Галочка внутри чекбокса */
.check-mark {
    color: white;
    font-size: 16px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

/* Состояние: чекбокс отмечен */
.employee-checkbox:checked ~ .checkbox-indicator {
    background: #10b981;
    border-color: #10b981;
}

.employee-checkbox:checked ~ .checkbox-indicator .check-mark {
    opacity: 1;
    transform: scale(1);
}

/* Информация о сотруднике */
.employee-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 2px;
}

.employee-name {
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
}

.employee-meta {
    font-size: 13px;
    color: #6b7280;
}

/* Пустое сообщение */
.empty-message {
    padding: 32px 16px;
    text-align: center;
    color: #6b7280;
}

.empty-message p {
    margin-bottom: 8px;
}

.empty-message a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

/* Заголовок страницы с подзаголовком */
.page-header {
    margin-bottom: 16px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.header-subtitle {
    font-size: 14px;
    color: #6b7280;
}

/* Адаптация tab-bar для 6 вкладок (переопределение) */
.tab-bar .tab-item {
    padding: 4px 2px;
    font-size: 11px;
}

.tab-bar .tab-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

/* История сотрудников - новые стили */
.employee-history-card {
    margin-bottom: 12px;
}

.employee-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
    transition: background 0.2s;
}

.employee-history-header:active {
    background: #f9fafb;
}

.chevron {
    font-size: 14px;
    color: #9ca3af;
    transition: transform 0.3s ease;
}

.employee-history-details {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.history-section {
    margin-bottom: 20px;
}

.history-section:last-child {
    margin-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.section-icon {
    font-size: 18px;
}

.work-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 8px;
}

.work-day-badge {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
}

.history-fine-item {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.history-fine-item:last-child {
    margin-bottom: 0;
}

.history-fine-item .fine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.history-fine-item .fine-amount {
    font-size: 16px;
    font-weight: 700;
    color: #dc2626;
}

.history-fine-item .fine-date {
    font-size: 12px;
    color: #9ca3af;
}

.history-fine-item .fine-reason {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 6px;
}

.fine-status {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
}

.fine-status.paid {
    background: #d1fae5;
    color: #065f46;
}

.fine-status.unpaid {
    background: #fee2e2;
    color: #991b1b;
}

.payment-detail-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span:first-child {
    color: #6b7280;
}

.detail-row span:last-child {
    font-weight: 600;
    color: #111827;
}

.detail-total {
    margin-top: 4px;
    padding-top: 12px !important;
    border-top: 2px solid #d1d5db !important;
}

.text-danger {
    color: #dc2626 !important;
}

.text-success {
    color: #059669 !important;
}

.empty-section {
    padding: 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
    background: #f9fafb;
    border-radius: 8px;
}

.week-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.week-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.week-btn:active {
    background: #e5e7eb;
    transform: scale(0.96);
}

.week-label {
    flex: 1;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}
