@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    background: white;
    min-height: 100vh;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-container h1 {
    text-align: center;
    color: #FF5050;
    margin-bottom: 10px;
}

.login-container h2 {
    text-align: center;
    color: #555;
    margin-bottom: 30px;
    font-size: 18px;
}

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

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

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

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: #e63939;
}

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

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

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

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

.btn-warning {
    background: #fd7e14;
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    margin: 0 5px;
}

.link {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #FF5050;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

.error-message {
    color: #dc3545;
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    background: #f8d7da;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    color: #28a745;
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    background: #d4edda;
    display: none;
}

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

/* Dashboard */
header {
    background: white;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #FF5050;
}

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

.dashboard-content {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Calendar */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 20px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.calendar-day {
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.calendar-day.day-header {
    font-weight: bold;
    background: #f8f9fa;
    cursor: default;
    justify-content: center;
    align-items: center;
}

.calendar-day.workday {
    background: #fff;
    border-color: #28a745;
}

.calendar-day.weekend {
    background: #f8f9fa;
    color: #999;
}
.calendar-day.holiday {
    background: #F44336 !important;
    color: white !important;
}

.calendar-day.selected {
    background: #FFC400 !important;
    color: #333 !important;
    border-color: #E6B000 !important;
}

/* Pending leaves - lighter colors */
.calendar-day.workday.leave-pending.absence-sick,
.calendar-day.leave-pending.absence-sick {
    background: #D4E8F7 !important;
    border: 2px solid #4DA6F7 !important;
    color: #1565C0 !important;
}

.calendar-day.workday.leave-pending.absence-regular,
.calendar-day.leave-pending.absence-regular {
    background: #D1E7E4 !important;
    border: 2px solid #26A69A !important;
    color: #00695C !important;
}

.calendar-day.workday.leave-pending.absence-unpaid,
.calendar-day.leave-pending.absence-unpaid {
    background: #F0D4E8 !important;
    border: 2px solid #D17BA8 !important;
    color: #7B1FA2 !important;
}

/* Approved leaves - darker colors */
.calendar-day.workday.leave-approved.absence-sick,
.calendar-day.leave-approved.absence-sick {
    background: #4DA6F7 !important;
    border: 2px solid #1976D2 !important;
    color: white !important;
}

.calendar-day.workday.leave-approved.absence-regular,
.calendar-day.leave-approved.absence-regular {
    background: #26A69A !important;
    border: 2px solid #00796B !important;
    color: white !important;
}

.calendar-day.workday.leave-approved.absence-unpaid,
.calendar-day.leave-approved.absence-unpaid {
    background: #D17BA8 !important;
    border: 2px solid #AD1457 !important;
    color: white !important;
}

.calendar-day.leave-rejected {
    background: #f8d7da;
    border-color: #dc3545;
}

.calendar-day.leave-cancelled {
    background: #e2e3e5;
    border-color: #6c757d;
    opacity: 0.6;
}

.calendar-day:hover:not(.day-header):not(.weekend):not(.holiday) {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.day-number {
    font-weight: bold;
    font-size: 16px;
}

.day-label {
    font-size: 10px;
    margin-top: 5px;
    text-align: center;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.legend-item span {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1.5px solid #ddd;
}

.legend-item .workday {
    background: #fff;
    border-color: #28a745;
}

.legend-item .weekend {
    background: #f8f9fa;
}


.legend-item .holiday {
    background: #F44336;
}

.legend-item .selected {
    background: #FFC400;
}

.legend-item .pending-sick {
    background: #D4E8F7;
    border: 2px solid #4DA6F7;
}

.legend-item .pending-regular {
    background: #D1E7E4;
    border: 2px solid #26A69A;
}

.legend-item .pending-unpaid {
    background: #F0D4E8;
    border: 2px solid #D17BA8;
}

.legend-item .approved-sick {
    background: #4DA6F7;
    border: 2px solid #1976D2;
}

.legend-item .approved-regular {
    background: #26A69A;
    border: 2px solid #00796B;
}

.legend-item .approved-unpaid {
    background: #D17BA8;
    border: 2px solid #AD1457;
}

.leave-request-item {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    background: white;
}

.leave-request-item.pending.absence-sick {
    background: #D4E8F7 !important;
    border-left: 4px solid #4DA6F7;
}

.leave-request-item.pending.absence-regular {
    background: #D1E7E4 !important;
    border-left: 4px solid #26A69A;
}

.leave-request-item.pending.absence-unpaid {
    background: #F0D4E8 !important;
    border-left: 4px solid #D17BA8;
}

.leave-request-item.approved.absence-sick {
    background: #4DA6F7 !important;
    border-left: 4px solid #1976D2;
    color: white;
}

.leave-request-item.approved.absence-regular {
    background: #26A69A !important;
    border-left: 4px solid #00796B;
    color: white;
}

.leave-request-item.approved.absence-unpaid {
    background: #D17BA8 !important;
    border-left: 4px solid #AD1457;
    color: white;
}

.leave-request-item.rejected {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.leave-request-item.cancelled {
    background: #e2e3e5;
    border-left: 4px solid #6c757d;
    opacity: 0.7;
}
/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #dc3545;
}

/* Modal Steps */
.modal-step {
    margin: 20px 0;
}

.date-selection-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.date-selection-info strong {
    color: #FF5050;
}

.help-text {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.action-buttons .btn {
    flex: 1;
    max-width: 200px;
}

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

.modal-buttons .btn {
    flex: 1;
    width: auto !important;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-label:hover {
    border-color: #FF5050;
    background: #f8f9fa;
}

.radio-label input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-label input[type="radio"]:checked + span {
    font-weight: bold;
    color: #FF5050;
}

.radio-label span {
    flex: 1;
}

/* Admin Dashboard */
.admin-nav {
    display: flex;
    background: white;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #f8f9fa;
}

.nav-btn.active {
    border-bottom-color: #FF5050;
    color: #FF5050;
    font-weight: bold;
}

.admin-content {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

.tab-content {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.tab-header {
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

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

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

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

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

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

.badge-cancelled {
    background: #e2e3e5;
    color: #383d41;
}

.form-control {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar {
        grid-template-columns: repeat(7, 1fr);
        gap: 5px;
        padding: 10px;
    }
    
    .calendar-day {
        padding: 5px;
        font-size: 12px;
    }
    
    .legend {
        flex-direction: column;
    }
    
    .admin-nav {
        flex-wrap: wrap;
    }
}
