* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #e9ecef;
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #495057;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

button {
    background-color: #007bff;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

button:hover:not(:disabled) {
    background-color: #0056b3;
}

button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.btn-add {
    background-color: #28a745;
}

.btn-add:hover {
    background-color: #218838;
}

.btn-save {
    background-color: #007bff;
    width: 100%;
    margin-top: 1rem;
}

.btn-show {
    background-color: #17a2b8;
    width: 100%;
    margin-top: 1rem;
}

.btn-show:hover {
    background-color: #138496;
}

.error-message {
    color: #dc3545;
    padding: 0.5rem;
    margin: 1rem 0;
    border: 1px solid #dc3545;
    border-radius: 4px;
    background-color: #f8d7da;
}

.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.btn-logout {
    background-color: #dc3545;
    padding: 0.5rem 1.5rem;
}

.btn-logout:hover {
    background-color: #c82333;
}

.dashboard-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab-button {
    background-color: #6c757d;
    padding: 0.75rem 1.5rem;
}

.tab-button.active {
    background-color: #007bff;
}

.tab-content {
    display: none;
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

/* Стили для перерывов */
.breaks-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.counter {
    font-size: 1.1rem;
    font-weight: 500;
}

.btn-break {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    min-width: 200px;
}

.btn-break.away {
    background-color: #28a745;
}

.btn-break.away:hover:not(:disabled) {
    background-color: #218838;
}

.btn-break.back {
    background-color: #dc3545;
}

.btn-break.back:hover:not(:disabled) {
    background-color: #c82333;
}

.break-timer {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.break-timer.warning {
    color: #dc3545;
    background-color: #f8d7da;
    border-color: #dc3545;
    animation: pulse 1s infinite;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.late-return {
    color: #dc3545;
    font-weight: bold;
}

/* Стили для обедов */
.lunch-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.lunch-slot {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.lunch-slot.available {
    background-color: #d4edda;
    border-color: #28a745;
}

.lunch-slot.partial {
    background-color: #fff3cd;
    border-color: #ffc107;
}

.lunch-slot.full {
    background-color: #f8d7da;
    border-color: #dc3545;
    cursor: not-allowed;
}

.lunch-slot.my-booking {
    border-width: 3px;
    border-color: #007bff;
    background-color: #cce5ff;
}

.lunch-slot strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.slot-status {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.slot-users {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
}

/* Стили для админки */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
}

.admin-tab-button {
    background-color: transparent;
    color: #495057;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 500;
    white-space: nowrap;
}

.admin-tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.admin-tab-button:hover {
    color: #007bff;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.admin-section h3 {
    margin-bottom: 1rem;
    color: #495057;
}

.admin-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #6c757d;
}

.control-group select,
.control-group input {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    margin: 0 0.25rem;
}

.btn-edit {
    background-color: #ffc107;
    color: #212529;
}

.btn-edit:hover {
    background-color: #e0a800;
}

.btn-delete {
    background-color: #dc3545;
}

.btn-delete:hover {
    background-color: #c82333;
}

.btn-reset {
    background-color: #17a2b8;
}

.btn-reset:hover {
    background-color: #138496;
}

/* Стили для скроллируемых таблиц в админке */
#adminBreaksContent table {
    margin-top: 0;
}

#adminBreaksContent thead {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
}

#adminBreaksContent thead th {
    background: #f8f9fa;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

#adminBreaksContent tbody tr:hover {
    background-color: #e9ecef;
}

/* Стили для таблицы аудита */
#auditTable tbody tr:hover {
    background-color: #f8f9fa;
}

#auditTable small {
    display: block;
    margin-top: 2px;
}

/* Стили для статистики */
.statistics-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.statistics-summary {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid #007bff;
}

.statistics-summary h4 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.statistics-summary p {
    margin: 0.25rem 0;
    color: #6c757d;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

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

.modal-header h3 {
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    line-height: 1;
}

.btn-close:hover {
    color: #000;
}

/* Адаптивность */
@media (max-width: 768px) {
    .dashboard {
        padding: 0.5rem;
    }
    
    .lunch-slots {
        grid-template-columns: 1fr;
    }
    
    .admin-controls {
        flex-direction: column;
    }
    
    .statistics-filters {
        grid-template-columns: 1fr;
    }
    
    .breaks-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-break {
        width: 100%;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .admin-tab-button {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Стили для скроллбара */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}