/* Admin Interface CSS */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    background: #f8fafc;
    color: #2d3748;
    line-height: 1.5;
}

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px 32px;
    width: 100%;
    max-width: 450px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.login-header p {
    color: #718096;
    font-size: 16px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    color: #718096;
    font-size: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.login-btn,
.save-btn,
.add-btn,
.export-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-btn:hover,
.save-btn:hover,
.add-btn:hover,
.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid #e53e3e;
    font-size: 14px;
}

/* Admin Dashboard */
.admin-container {
    min-height: 100vh;
}

.admin-header {
    background: white;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-actions span {
    color: #718096;
    font-weight: 500;
}

.logout-btn {
    padding: 8px 16px;
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #cbd5e0;
}

.admin-nav {
    background: white;
    padding: 0 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.nav-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-btn:hover {
    color: #4a5568;
}

.nav-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.admin-main {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
}

/* Employees Grid */
.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.employee-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.employee-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.employee-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2d3748;
}

.employee-card .username {
    color: #718096;
    font-size: 14px;
    margin-bottom: 12px;
}

.employee-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.employee-info span {
    font-size: 14px;
    color: #4a5568;
}

.employee-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.edit-btn,
.delete-btn,
.reset-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.edit-btn {
    background: #4299e1;
    color: white;
}

.edit-btn:hover {
    background: #3182ce;
}

.delete-btn {
    background: #f56565;
    color: white;
}

.delete-btn:hover {
    background: #e53e3e;
}

.reset-btn {
    background: #ed8936;
    color: white;
}

.reset-btn:hover {
    background: #dd6b20;
}

.employee-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.employee-status.active {
    background: #c6f6d5;
    color: #22543d;
}

.employee-status.inactive {
    background: #fed7d7;
    color: #742a2a;
}

/* Records Table */
.records-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.records-table {
    width: 100%;
    border-collapse: collapse;
}

.records-table th,
.records-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.records-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

.records-table tr:hover {
    background: #f7fafc;
}

/* Filters */
.filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filters select,
.filters input {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.filters button {
    padding: 8px 16px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.filters button:hover {
    background: #3182ce;
}

/* Export Form */
.export-form {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.export-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #718096;
}

.modal-close:hover {
    color: #4a5568;
}

.employee-form {
    padding: 24px;
}

.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.cancel-btn {
    padding: 12px 24px;
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn:hover {
    background: #cbd5e0;
}

/* Message Modal */
#messageModal .modal-content {
    max-width: 400px;
    text-align: center;
    padding: 32px 24px;
}

#messageModal h3 {
    margin-bottom: 16px;
    font-size: 20px;
    color: #2d3748;
}

#messageModal p {
    margin-bottom: 24px;
    color: #718096;
    line-height: 1.6;
}

.modal-btn {
    padding: 12px 32px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn:hover {
    background: #3182ce;
}

.admin-header {
    background: white;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f7fafc;
    border-radius: 8px;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.home-btn:hover {
    background: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.edit-records-container {
    margin-top: 20px;
}

.edit-record-form {
    padding: 24px;
}

.edit-record-form .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.edit-record-form .delete-btn {
    background: #f56565;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.edit-record-form .delete-btn:hover {
    background: #e53e3e;
}

.filters {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
}

.filters select, .filters input[type="date"], .filters button {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

/* Export styling */
.exports-form {
    background: #f7fafc;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.export-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    min-width: 160px;
}

.excel-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.excel-btn:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-1px);
}

.pdf-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pdf-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
}

.preview-btn {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.preview-btn:hover {
    background: linear-gradient(135deg, #dd6b20 0%, #c05621 100%);
    transform: translateY(-1px);
}

.export-preview {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
}

.export-preview h3 {
    color: #2d3748;
    margin-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.export-preview table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.export-preview th, .export-preview td {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.export-preview th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

.employee-actions .delete-btn:last-child {
    background: #dc2626 !important;
    border: 2px solid #b91c1c;
}

.employee-actions .delete-btn:last-child:hover {
    background: #b91c1c !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.permanent-delete-btn {
    background: #dc2626 !important;
    border: 2px solid #b91c1c !important;
}

.permanent-delete-btn:hover {
    background: #b91c1c !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-actions {
        align-self: stretch;
        justify-content: space-between;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .employees-grid {
        grid-template-columns: 1fr;
    }
    
    .records-table {
        font-size: 14px;
    }
    
    .records-table th,
    .records-table td {
        padding: 8px 12px;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .export-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .admin-main {
        padding: 16px;
    }
    
    .modal-content {
        margin: 10px;
    }
    
    .employee-form {
        padding: 16px;
    }
}