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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Styles de connexion */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

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

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

.login-box h2 {
    color: #666;
    font-size: 16px;
    text-align: center;
    margin-bottom: 30px;
}

/* Styles d'administration */
.admin-container {
    background: #f5f5f5;
    min-height: 100vh;
}

.admin-header {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.admin-header h1 {
    color: #333;
    font-size: 24px;
}

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

.btn-logout {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
}

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

/* Formulaires */
.form-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.form-section h2 {
    margin-bottom: 20px;
    color: #333;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

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

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

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

/* Boutons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

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

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

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

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

.btn-edit {
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.btn-delete {
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

/* Filtres */
.filters-section {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Liste des techniciens */
.techniciens-list h2 {
    margin-bottom: 20px;
    color: #333;
}

.techniciens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.technicien-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.technicien-card:hover {
    transform: translateY(-5px);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 18px;
}

.badge {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.badge.active {
    background: #28a745;
}

.badge.inactive {
    background: #dc3545;
}

.card-body {
    padding: 15px;
}

.card-body p {
    margin: 10px 0;
    color: #555;
}

.qr-code {
    text-align: center;
    margin: 15px 0;
}

.card-actions {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

/* Styles des badges */
.badge-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.badge-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
}

.badge-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 30px;
}

.company-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    border-radius: 50%;
}

.badge-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.badge-header h2 {
    font-size: 16px;
    opacity: 0.9;
}

.badge-content {
    padding: 30px;
}

.info-section {
    margin-bottom: 30px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.label {
    font-weight: bold;
    color: #555;
}

.value {
    color: #333;
}

.badge-id {
    font-family: monospace;
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}

.statut-badge {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.statut-actif {
    background: #d4edda;
    color: #155724;
}

.statut-inactif {
    background: #f8d7da;
    color: #721c24;
}

.qr-code-section {
    text-align: center;
    margin: 20px 0;
}

.qr-code-section p {
    margin-top: 10px;
    color: #666;
    font-size: 12px;
}

.badge-footer {
    background: #f8f9fa;
    padding: 15px;
    text-align: center;
    font-size: 12px;
    color: #666;
}

/* Alertes */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .techniciens-grid {
        grid-template-columns: 1fr;
    }
    
    .badge-card {
        margin: 20px;
    }
    
    .info-row {
        flex-direction: column;
    }
    
    .label {
        margin-bottom: 5px;
    }
}
/* ── Notif toast ──────────────────────────────────────── */
.notif {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .95rem;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    animation: fadeIn .25s ease;
}
.notif-success { background: #2ecc71; color: #fff; }
.notif-error   { background: #e74c3c; color: #fff; }
@keyframes fadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* ── Photo dans les cartes dashboard ─────────────────── */
.tech-photo-thumb-frame {
    width: 48px;
    height: 62px;
    overflow: hidden;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #f0f0f0;
    flex-shrink: 0;
}
.tech-photo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}
.tech-photo-placeholder {
    width: 48px;
    height: 62px;
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Filtre Archivés ──────────────────────────────────── */
.filter-archive {
    background: #f0f0f0;
    color: #888;
    border: 1px dashed #bbb;
}
.filter-archive.active {
    background: #e67e22;
    color: #fff;
    border-color: #e67e22;
}
