/* Système générique de boutons pour le back-office du module Stages */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
    background: rgba(15, 23, 42, 0.7);
    color: #e5e7eb;
}

.btn i {
    font-size: 0.85em;
}

/* Tailles */

.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 12px;
}

.btn-lg {
    padding: 0.7rem 1.2rem;
    font-size: 14px;
}

/* Boutons compacts pour actions en tableau (suppression des marges inline) */

.btn-compact {
    padding: 0.25rem 0.55rem;
    font-size: 11px;
}

/* Boutons icône seule */

.btn-icon {
    padding: 0.3rem;
    border-radius: 9999px;
    min-width: 2rem;
    justify-content: center;
}

/* Pleine largeur */

.btn-block {
    display: flex;
    width: 100%;
}

/* Variantes de rôle (palette sombre du module) */

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: rgba(59, 130, 246, 0.6);
    color: #f9fafb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-color: rgba(59, 130, 246, 0.7);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.4);
    color: #e5e7eb;
}

.btn-secondary:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    border-color: rgba(22, 163, 74, 0.7);
    color: #f9fafb;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-success:hover {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
    border-color: rgba(22, 163, 74, 0.8);
}

.btn-danger {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
    border-color: rgba(239, 68, 68, 0.75);
    color: #f9fafb;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%);
    border-color: rgba(248, 113, 113, 0.9);
}

/* Tables: colonne "Actions" au plus proche du contenu */
table th.col-actions,
table td.col-actions,
table th.actions-cell,
table td.actions-cell {
    width: 1%;
    white-space: nowrap;
}

/* Conteneurs d'actions dans les cellules: ne pas prendre toute la largeur */
table td .actions-cell,
table td .actions-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

/* Variantes neutres / outline / lien */

.btn-outline {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
}

.btn-outline:hover {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.9);
}

.btn-muted {
    background: transparent;
    border-color: rgba(75, 85, 99, 0.9);
    color: #9ca3af;
}

.btn-muted:hover {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(107, 114, 128, 0.9);
}

.btn-link {
    background: transparent;
    border: none;
    padding: 0;
    color: #60a5fa;
    box-shadow: none;
}

.btn-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* États */

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.45);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn[disabled],
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}
