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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 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: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
}

header h1 {
    font-size: 1.8em;
    margin-bottom: 15px;
}

.top-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.top-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 25px;
    transition: background 0.3s;
}

.top-nav a:hover, .top-nav a.active {
    background: rgba(255,255,255,0.2);
}

.welcome {
    margin-top: 15px;
    font-size: 0.9em;
    opacity: 0.9;
}

main {
    padding: 30px;
}

.form-card, .info-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.form-card h2, .info-card h3 {
    margin-bottom: 20px;
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
}

.stat-label {
    margin-top: 10px;
    font-size: 0.9em;
    opacity: 0.9;
}

.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 25px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.filter-btn.active, .filter-btn:hover {
    background: #667eea;
    color: white;
}

.table-responsive {
    overflow-x: auto;
}

.requests-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

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

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

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.btn-small {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    margin: 2px;
}

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

.btn-reject {
    background: #dc3545;
    color: white;
}

.comment-input {
    padding: 4px;
    font-size: 0.85em;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Calendar Styles */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.cal-nav-btn {
    padding: 8px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: background 0.3s;
}

.cal-nav-btn:hover {
    background: #5a67d8;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.calendar-day-header {
    background: #f8f9fa;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    color: #555;
}

.calendar-day {
    background: white;
    min-height: 120px;
    padding: 10px;
    position: relative;
}

.calendar-day.empty {
    background: #fafafa;
}

.calendar-day.weekend {
    background: #fff5f5;
}

.day-number {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #333;
}

.day-number.today {
    background: #667eea;
    color: white;
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
}

.leave-indicator {
    margin-top: 5px;
}

.leave-name {
    font-size: 0.75em;
    background: #e8f0fe;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 3px;
    color: #1a73e8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-day.has-leave {
    background: #fff9e6;
}

.legend {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.today-demo {
    background: #667eea;
}

.leave-demo {
    background: #fff9e6;
    border: 1px solid #ffc107;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    main {
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 5px;
    }
    
    .day-number {
        font-size: 0.9em;
    }
    
    .leave-name {
        font-size: 0.65em;
        white-space: normal;
        word-break: break-word;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .requests-table th, .requests-table td {
        font-size: 0.85em;
        padding: 8px;
    }
    
    header h1 {
        font-size: 1.4em;
    }
    
    .top-nav {
        gap: 10px;
    }
    
    .top-nav a {
        padding: 6px 12px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .calendar-day-header {
        padding: 8px;
        font-size: 0.8em;
    }
    
    .calendar-day {
        min-height: 60px;
    }
}