:root {
    --bg-primary: #1f1f1f;
    --bg-card: #292929;
    --color-text: #e0e0e0;
    --color-label: #ffffff;
    --color-placeholder: #aaa;
    --color-accent: #ff8a00;
    --overlay-bg: rgba(20,20,20,0.7);
    --radius: 0.5rem;
    --input-padding: 0.5rem 0.75rem;
    --transition: 0.3s;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    background: var(--bg-primary);
    color: var(--color-text);
}

h3, .card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-label);
}

.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* --- Boutons personnalisés --- */
.btn-custom {
    display: block;
    width: 100%;
    padding: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    background-color: var(--color-accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: opacity var(--transition);
}
.btn-custom:hover {
    opacity: 0.9;
}

/* Bouton poubelle Bootstrap Icon */
.btn-trash {
    background: transparent;
    border: none;
    color: #f44336;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
    font-size: 1.3rem;
}
.btn-trash:hover {
    background: #333;
    color: #fff;
}

/* Bouton download Bootstrap Icon */
.text-link {
    color: var(--color-accent);
    background: transparent;
    border: none;
    padding: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
    font-size: 1.3rem;
}
.text-link:hover {
    background: #222;
    color: #fff;
    text-decoration: none;
}

/* Centrage des icônes dans les cellules */
td[data-label="Télécharger"], td[data-label="Supprimer"] {
    text-align: center;
    vertical-align: middle;
}

/* Taille des icônes */
.text-link i, .btn-trash i {
    font-size: 1.3rem;
    line-height: 1;
    vertical-align: middle;
}

/* --- Formulaires --- */
input, textarea {
    color: var(--color-text);
    background: #222;
    border: 1px solid #333;
}
input::placeholder, textarea::placeholder {
    color: var(--color-placeholder);
    opacity: 1;
}

/* --- Overlay & spinner --- */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1000;
    text-align: center;
    padding: 1rem;
}
.spinner {
    width: 3rem;
    height: 3rem;
    border: 5px solid #ddd;
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.message {
    font-size: 1.2rem;
    margin-top: 1rem;
    display: none;
}

/* --- Responsive --- */
@media (max-width: 767px) {
    .row.g-4 { gap: 2rem; }
    .col-md-6 { flex: 0 0 100%; max-width: 100%; }
}


/* Formulaires */
input, textarea {
    color: var(--color-text);
    background: #222;
    border: 1px solid #333;
}
input::placeholder, textarea::placeholder {
    color: var(--color-placeholder);
    opacity: 1;
}
.form-label {
    color: var(--color-label) !important;
}
