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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 30px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5em;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.controls label {
    font-weight: 600;
    color: #555;
}

.controls select,
.controls input {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.controls select:focus,
.controls input:focus {
    outline: none;
    border-color: #667eea;
}

.controls button {
    padding: 10px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.controls button:active {
    transform: translateY(0);
}

.excel-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.excel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.excel-btn:active {
    transform: translateY(0);
}

.print-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.print-btn:active {
    transform: translateY(0);
}

.info-box {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border-left: 5px solid #2196f3;
}

.info-box h3 {
    color: #1976d2;
    margin-bottom: 15px;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
}

.info-box li {
    padding: 8px 0;
    color: #555;
}

.info-box strong {
    color: #1976d2;
}

.guards-section {
    background: #fff3e0;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border-left: 5px solid #ff9800;
}

.guards-section h3 {
    color: #e65100;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.guards-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.guard-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.guard-input-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.guard-input-group input {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.guard-input-group input:focus {
    outline: none;
    border-color: #ff9800;
}

.save-btn {
    grid-column: 1 / -1;
    padding: 12px 25px;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
}

.save-btn:active {
    transform: translateY(0);
}

.save-success {
    background: #4caf50;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    margin-top: 10px;
    text-align: center;
    display: none;
    animation: fadeIn 0.3s;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4);
}

.save-success.show {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#scheduleContainer {
    overflow-x: auto;
    margin-bottom: 30px;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
}

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

.schedule-table th {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.schedule-table th:last-child {
    border-right: none;
}

.schedule-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

.schedule-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.schedule-table tbody tr:hover {
    background: #e3f2fd;
}

.day-cell {
    font-weight: 600;
    color: #333;
    background: #f5f5f5 !important;
}

.shift-day {
    background: #c8e6c9 !important;
    color: #2e7d32;
    font-weight: 600;
}

.shift-night {
    background: #90caf9 !important;
    color: #1565c0;
    font-weight: 600;
}

.rest-day {
    background: #ffecb3 !important;
    color: #f57c00;
    font-weight: 600;
}

.empty-cell {
    background: #fafafa;
    color: #999;
}

.statistics {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
}

.statistics h3 {
    color: #333;
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stat-card h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 0.9em;
    text-transform: uppercase;
}

.stat-card .stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
}

.stat-card .stat-label {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls select,
    .controls input,
    .controls button {
        width: 100%;
    }
    
    .schedule-table {
        font-size: 0.85em;
    }
    
    .schedule-table th,
    .schedule-table td {
        padding: 8px 5px;
    }
    
    .guards-form {
        grid-template-columns: 1fr;
    }
}
