:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #4cc9f0;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --text-color: #2b2d42;
    --light-bg: #f8f9fa;
    --sidebar-bg: #2b2d42;
    --sidebar-text: #ffffff;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
}

/* Login Page */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.login-container {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.login-header h2 {
    color: var(--text-color);
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
}

/* Admin Layout */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu li.active a {
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--accent-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.content-header h1 {
    color: var(--text-color);
    font-size: 2rem;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

.stat-info p {
    color: #666;
    font-size: 0.9rem;
}

/* Tables */
.table-container {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-color);
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Status Badges */
.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active {
    background: #e8f5e8;
    color: var(--success-color);
}

.status-expired {
    background: #fff3e0;
    color: var(--warning-color);
}

.status-revoked {
    background: #ffebee;
    color: var(--error-color);
}

.role-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.role-admin {
    background: #e3f2fd;
    color: var(--primary-color);
}

.role-user {
    background: #f3e5f5;
    color: #9c27b0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-action {
    padding: 8px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-download {
    background: #e8f5e8;
    color: var(--success-color);
}

.btn-view {
    background: #e3f2fd;
    color: var(--primary-color);
}

.btn-edit {
    background: #fff3e0;
    color: var(--warning-color);
}

.btn-delete {
    background: #ffebee;
    color: var(--error-color);
}

.btn-action:hover {
    transform: translateY(-2px);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group i {
    position: absolute;
    right: 15px;
    top: 40px;
    color: #666;
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: var(--secondary-color);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #e8f5e8;
    border-color: var(--success-color);
    color: #2e7d32;
}

.alert-error {
    background: #ffebee;
    border-color: var(--error-color);
    color: #c62828;
}

.alert-warning {
    background: #fff3e0;
    border-color: var(--warning-color);
    color: #ef6c00;
}

/* 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-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Import Styles */
.import-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.import-card {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
}

.import-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.import-form {
    margin-top: 30px;
}

.file-upload {
    margin-bottom: 20px;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-label {
    display: inline-block;
    padding: 15px 30px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-label:hover {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

.file-name {
    margin-top: 10px;
    color: #666;
}

.import-template {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.template-table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
}

.template-table th,
.template-table td {
    padding: 10px;
    border: 1px solid #dee2e6;
    text-align: left;
    font-size: 0.9rem;
}

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

/* Recent Activity */
.recent-activity {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.activity-list {
    margin-top: 20px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item i {
    width: 40px;
    height: 40px;
    background: #e3f2fd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.activity-content p {
    margin-bottom: 5px;
    color: var(--text-color);
}

.activity-time {
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .admin-container {
        flex-direction: column;
    }
    
    .import-container {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Certificate View */
.certificate-view {
    padding: 20px;
}

.certificate-view .detail-row {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.certificate-view .detail-label {
    font-weight: 600;
    color: var(--text-color);
    min-width: 200px;
}

.certificate-view .detail-value {
    color: #666;
    flex: 1;
}

/* Email Button */
.btn-email {
    background: #3498db;
    color: white;
}

.btn-email:hover {
    background: #2980b9;
}

/* Upload Preview */
.upload-preview {
    margin-top: 15px;
    text-align: center;
    padding: 15px;
    border: 2px dashed #dee2e6;
    border-radius: 5px;
}

/* Responsive Form Grid */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}