@import url('login.css');

:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #6c5ce7);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--secondary-color);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--secondary-color);
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #3a5bd9;
}

.alert {
    padding: 12px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.alert-danger {
    background-color: #f8d7da;
    color: var(--danger-color);
    border: 1px solid #f5c6cb;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: #fff;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #fff;
}

.sidebar-header p {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-menu li a i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* Main Content Styles */
.main-content {
    margin-left: 250px;
    padding: 2rem;
    min-height: 100vh;
    background: #f8f9fa;
}

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

.card-body {
    padding: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background-color: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

.stat-icon i {
    font-size: 24px;
    color: #2c3e50;
}

.stat-info h3 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.alert {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    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 input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3498db;
    outline: none;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.attendance-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.attendance-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.attendance-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.attendance-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.attendance-actions {
    text-align: center;
    margin: 2rem 0;
}

.attendance-actions .btn {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.attendance-actions .btn i {
    margin-right: 0.5rem;
}

.attendance-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.recent-attendance {
    margin-top: 2rem;
}

.recent-attendance h3 {
    margin-bottom: 1rem;
    color: #333;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.present {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.absent {
    background-color: #f8d7da;
    color: #721c24;
}

.status-badge.late {
    background-color: #fff3cd;
    color: #856404;
}

@media (max-width: 768px) {
    .attendance-info {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .attendance-info {
        grid-template-columns: 1fr;
    }
}

/* Reports Page Styles */
.report-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.report-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.report-card h3 {
    margin: 0 0 20px;
    color: #333;
    font-size: 18px;
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.filter-form .form-group {
    margin: 0;
}

.filter-form label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.filter-form input,
.filter-form select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-form button {
    align-self: flex-end;
}

/* Chart Containers */
canvas {
    max-width: 100%;
    height: 300px !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 0;
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        width: 250px;
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .report-cards {
        grid-template-columns: 1fr;
    }
    
    .filter-form {
        grid-template-columns: 1fr;
    }
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.card-body {
    padding: 20px;
}

.attendance-status {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attendance-status p {
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leave-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leave-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.leave-list li:last-child {
    border-bottom: none;
}

.leave-type {
    font-weight: 500;
    color: #333;
}

.leave-dates {
    color: #666;
    font-size: 0.9em;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.status-badge.present {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.absent {
    background-color: #f8d7da;
    color: #721c24;
}

.status-badge.late {
    background-color: #fff3cd;
    color: #856404;
}

.status-badge.pending {
    background-color: #cce5ff;
    color: #004085;
}

.status-badge.approved {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.profile-form {
    max-width: 600px;
    margin: 0 auto;
}

.profile-form .form-group {
    margin-bottom: 20px;
}

.profile-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--secondary-color);
    font-weight: 500;
}

.profile-form input,
.profile-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.profile-form input:focus,
.profile-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.profile-form textarea {
    resize: vertical;
    min-height: 100px;
}

.profile-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.profile-info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.profile-info-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.profile-info-value {
    font-size: 1.1rem;
    color: var(--dark-color);
    font-weight: 500;
}

/* Leave Form Styles */
.leave-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.leave-form .form-group {
    margin-bottom: 20px;
}

.leave-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.leave-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--secondary-color);
    font-weight: 500;
}

.leave-form input,
.leave-form select,
.leave-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s;
    background-color: white;
}

.leave-form input:focus,
.leave-form select:focus,
.leave-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.1);
}

.leave-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.leave-form textarea {
    resize: vertical;
    min-height: 100px;
}

.leave-form .btn {
    margin-top: 10px;
}

/* Status Badge Styles */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.pending {
    background-color: var(--warning-color);
    color: #856404;
}

.status-badge.approved {
    background-color: var(--success-color);
    color: #155724;
}

.status-badge.rejected {
    background-color: var(--danger-color);
    color: #721c24;
}

/* Leave Management Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.data-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    color: #212529;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

.data-table .status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
}

.data-table .status-badge.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.data-table .status-badge.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.data-table .status-badge.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.data-table .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    margin-right: 5px;
}

.data-table .btn-success {
    background-color: #28a745;
    color: white;
    border: none;
}

.data-table .btn-success:hover {
    background-color: #218838;
}

.data-table .btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
}

.data-table .btn-danger:hover {
    background-color: #c82333;
}

.data-table .btn-info {
    background-color: #17a2b8;
    color: white;
    border: none;
}

.data-table .btn-info:hover {
    background-color: #138496;
}

/* Leave Filters */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
}

.filter-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
}

.filter-group select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Responsive Table */
@media (max-width: 768px) {
    .data-table {
        display: block;
        overflow-x: auto;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
}

/* Quick Actions Styles */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.action-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: #007bff;
}

.action-item i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.action-item span {
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
}

@media (max-width: 768px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.message-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.message-header h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.message-meta {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

.message-body {
    color: #333;
    line-height: 1.6;
}

/* Ensure modal is visible when displayed */
.modal[style*="display: block"] {
    display: flex !important;
} 