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

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

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 10px;
    color: #333;
}

.login-box .subtitle {
    color: #666;
    margin-bottom: 30px;
}

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

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

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

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

.error-message {
    background-color: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-success, .btn-delete {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #5568d3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

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

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

.btn-delete {
    background-color: #dc3545;
    color: white;
    padding: 5px 10px;
}

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

/* Main Layout */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    background-color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    gap: 20px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    padding: 8px 16px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-action:hover {
    background-color: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-action:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loading-content {
    background-color: white;
    padding: 30px 50px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.date-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.period-selector-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.period-dropdown {
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 5px;
    background-color: white;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.2s;
}

.period-dropdown:hover {
    background-color: #f0f4ff;
}

.period-dropdown:focus {
    outline: none;
    border-color: #5568d3;
    background-color: white;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.date-input-group label {
    font-weight: 500;
    color: #555;
}

.date-input-group input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

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

/* Кнопки периодов удалены - заменены на dropdown */

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: white;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    padding: 20px;
}

.sidebar h2 {
    margin-bottom: 15px;
    font-size: 18px;
}

.restaurant-list {
    list-style: none;
}

.restaurant-item {
    padding: 12px;
    margin-bottom: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.restaurant-item:hover {
    background-color: #f0f0f0;
}

.restaurant-item.active {
    background-color: #667eea;
    color: white;
}

/* Tabel Content */
.tabel-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f5f5f5;
}

#tabel-container h2 {
    margin-bottom: 20px;
}

.tabel-controls {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.tabel-table {
    width: 100%;
    background-color: white;
    border-collapse: collapse;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tabel-table th,
.tabel-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

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

.tabel-table input[type="text"],
.tabel-table input[type="time"] {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

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

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

.empty-state p {
    font-size: 18px;
}

/* Date sections */
.date-section {
    margin-bottom: 30px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.date-header {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.tabel-table-grouped {
    margin-top: 10px;
}

.position-row {
    background-color: transparent;
}

.position-header-cell {
    background-color: #e8eaf6;
    color: #3f51b5;
    /* padding: 5px 15px; */
    font-size: 12px;
    font-weight: 600;
    border-left: 4px solid #667eea;
}

.position-group-body {
    background-color: transparent;
}

.add-employee-section {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
}

.employee-search-wrapper {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 0;
    min-width: 300px;
    position: relative;
}

.employee-search {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.2s;
}

.employee-search:focus {
    outline: none;
    border-color: #667eea;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item strong {
    flex: 1;
    color: #333;
}

.result-position {
    padding: 2px 8px;
    background-color: #e3f2fd;
    border-radius: 3px;
    font-size: 12px;
    color: #1976d2;
}

.result-rate {
    padding: 2px 8px;
    background-color: #f3e5f5;
    border-radius: 3px;
    font-size: 12px;
    color: #7b1fa2;
    font-weight: 500;
}

.no-results {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.btn-add-employee {
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
    margin-top: 0;
    flex-shrink: 0;
    flex-grow: 0;
    width: auto;
    max-width: 120px;
}

.btn-add-employee:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.employee-name-display {
    font-weight: 500;
    color: #333;
}

.date-section .tabel-table {
    margin-top: 10px;
    box-shadow: none;
}

.tabel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
}

.tabel-header-row h2 {
    margin: 0;
}

.position-filter {
    position: relative;
}

.filter-dropdown {
    position: relative;
}

.filter-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 220px;
    padding: 10px 15px;
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-dropdown-btn:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.filter-dropdown-btn:focus {
    outline: none;
    border-color: #667eea;
}

.dropdown-arrow {
    color: #667eea;
    font-size: 12px;
    margin-left: 10px;
}

.filter-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.filter-option:hover {
    background-color: #f8f9ff;
}

.filter-option input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.filter-option span {
    font-size: 14px;
}

.filter-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 5px 0;
}

/* Lock warning */
.lock-warning {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.lock-warning strong {
    font-size: 16px;
}

/* Table styling improvements */
.tabel-table input[type="number"] {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: right;
}

.tabel-table input[readonly], .tabel-table span {
    background-color: #f8f9fa;
    color: #666;
}

.tabel-table .start-time-display,
.tabel-table .end-time-display {
    display: inline-block;
    padding: 6px 8px;
    background-color: #e9ecef;
    border-radius: 3px;
    font-family: monospace;
}

.tabel-table .employee-position {
    display: none;
}

.tabel-table .employee-rate {
    display: inline-block;
    padding: 4px 8px;
    background-color: #f3e5f5;
    border-radius: 3px;
    font-size: 12px;
    color: #7b1fa2;
    font-weight: 500;
}

.tabel-table .total-amount {
    color: #28a745;
    font-size: 15px;
}

.tabel-table input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    background-color: #fff;
}

/* Datalist styling */
input[list]::-webkit-calendar-picker-indicator {
    display: none !important;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 700px;
}

.export-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.export-section:last-of-type {
    border-bottom: none;
}

.export-section h4 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 16px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.export-restaurants,
.export-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #667eea;
}

.modal-close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 20px;
}

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

.modal-body .form-group {
    margin-bottom: 15px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.modal-body .form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
}

.employee-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.employee-name-display {
    font-weight: 500;
    color: #333;
}

.employee-name-display.clickable {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.employee-name-display.clickable:hover {
    color: #667eea;
}

.employee-position-inline {
    display: inline-block;
    padding: 2px 8px;
    background-color: #e3f2fd;
    border-radius: 3px;
    font-size: 11px;
    color: #1976d2;
}

#salary-history {
    border-top: 2px solid #eee;
    padding-top: 15px;
}

#salary-history h4 {
    margin-bottom: 10px;
    font-size: 16px;
}

.history-item {
    padding: 8px;
    background-color: #f8f9fa;
    border-left: 3px solid #667eea;
    margin-bottom: 8px;
    border-radius: 3px;
}

.history-item.current {
    background-color: #e3f2fd;
    border-left-color: #28a745;
}

/* Responsive table */
@media screen and (max-width: 1400px) {
    .tabel-table {
        font-size: 12px;
    }
    
    .tabel-table th,
    .tabel-table td {
        padding: 8px 6px;
    }
    
    .tabel-table input {
        font-size: 12px;
        padding: 4px;
    }
}

