/* Ajoutez ces styles à la fin du fichier CSS existant */

.stats-grid {
    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: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
}

.recent-activity {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.recent-activity h3 {
    margin-bottom: 20px;
    color: #333;
}

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

.table-container .btn {
    margin-bottom: 20px;
}

/* Spinner styles */
.fa-spinner {
    color: #667eea;
    margin-bottom: 15px;
}

/* Modal improvements */
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.modal-body {
    padding: 10px 0;
}

/* Form improvements */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #4a5568;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.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 input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Button improvements */
.btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-danger {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%);
}

/* Close button */
.close-btn {
    float: right;
    font-size: 28px;
    font-weight: bold;
    color: #a0aec0;
    cursor: pointer;
    line-height: 20px;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #4a5568;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 15px;
    }
    
    nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 100%;
        text-align: left;
    }
    
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-server {
    background-color: #4299e1;
    color: white;
}

.badge-client {
    background-color: #48bb78;
    color: white;
}

.badge-warning {
    background-color: #ed8936;
    color: white;
}

/* Detail view styles */
.detail-group {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.detail-group:last-child {
    border-bottom: none;
}

.detail-group label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 5px;
}

.detail-group span {
    display: block;
    color: #2d3748;
    word-break: break-all;
}

.monospace {
    font-family: 'Courier New', monospace;
    background-color: #f7fafc;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
}

.certificate-preview {
    margin-top: 20px;
}

.certificate-preview label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #4a5568;
}

.cert-pem {
    width: 100%;
    height: 200px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background-color: #f7fafc;
    resize: vertical;
    white-space: pre;
    overflow-x: auto;
}

.actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
}

.loading-spinner i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 20px;
}

.loading-spinner p {
    color: #718096;
    font-size: 16px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #cbd5e0;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #4a5568;
}

/* Tooltip for buttons */
button[title] {
    position: relative;
}

button[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2d3748;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error {
    text-align: center;
    padding: 40px;
    color: #e53e3e;
    background: #fed7d7;
    border-radius: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.empty-state p {
    margin-bottom: 20px;
}

/* Section headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
}

/* Table improvements */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table th {
    background: #f7fafc;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background: #f7fafc;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status.valid {
    background: #c6f6d5;
    color: #22543d;
}

.status.revoked {
    background: #fed7d7;
    color: #742a2a;
}

.status.expired {
    background: #feebc8;
    color: #744210;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn i {
    font-size: 14px;
}

.btn.primary {
    background: #667eea;
    color: white;
}

.btn.primary:hover {
    background: #5a67d8;
}

.btn.small {
    padding: 4px 8px;
    font-size: 13px;
}

.btn.danger {
    background: #fc8181;
    color: #742a2a;
}

.btn.danger:hover {
    background: #f56565;
}

.btn.warning {
    background: #ed8936;
    color: #744210;
}

.btn.warning:hover {
    background: #dd6b20;
}

.actions {
    display: flex;
    gap: 5px;
}

/* Modal animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.hidden {
   display: none; 
}
