/* Variables globales */
:root {
    --primary-color: #8951d8;
    --primary-rgb: 137, 81, 216;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Styles de base */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--light-color);
    font-size: .875rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar-brand img {
    height: 30px;
    width: auto;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar .nav-link {
    font-weight: 500;
    padding: 1rem;
}

.sidebar .nav-link i {
    margin-right: 8px;
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Cartes */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    background: var(--light-color);
    border-radius: 8px;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Boutons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

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

.btn-primary:hover {
    filter: brightness(90%);
}

/* Formulaires */
.form-control {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    background: var(--light-color);
    color: var(--dark-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-rgb), 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

/* Utilitaires */
.bg-gradient {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-color));
}

.text-gradient {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary-color); /* Fallback pour les navigateurs qui ne supportent pas background-clip */
}

/* Icônes */
.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .sidebar {
        position: static;
        height: auto;
        padding-top: 0;
    }
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 1.5rem 0;
    background-color: var(--light-color);
    border-top: 1px solid #dee2e6;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Tableaux */
.table {
    --bs-table-bg: transparent;
    --bs-table-accent-bg: transparent;
    --bs-table-striped-color: var(--dark-color);
    --bs-table-striped-bg: rgba(0, 0, 0, 0.02);
    --bs-table-active-color: var(--dark-color);
    --bs-table-active-bg: rgba(0, 0, 0, 0.1);
    --bs-table-hover-color: var(--dark-color);
    --bs-table-hover-bg: rgba(0, 0, 0, 0.04);
    width: 100%;
    margin-bottom: 1rem;
    color: var(--dark-color);
    vertical-align: top;
    border-color: #dee2e6;
}

.table > :not(caption) > * > * {
    padding: 0.75rem;
    border-bottom-width: 1px;
}

.table-hover tbody tr:hover {
    background-color: var(--bs-table-hover-bg);
    color: var(--bs-table-hover-color);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.badge-success {
    background-color: var(--success-color);
    color: #fff;
}

.badge-warning {
    background-color: var(--warning-color);
    color: #000;
}

.badge-danger {
    background-color: var(--danger-color);
    color: #fff;
}

/* Alertes */
.alert {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    border-color: rgba(25, 135, 84, 0.2);
    color: var(--success-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.2);
    color: #997404;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
}

/* Tooltips personnalisés */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem;
    background-color: var(--dark-color);
    color: #fff;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

.alert {
    border: none;
    border-radius: 6px;
    font-size: 14px;
    padding: 12px 16px;
}

.alert-danger {
    background: rgba(205,61,100,0.1);
    color: var(--danger-color);
}

.alert-success {
    background: rgba(11,163,96,0.1);
    color: var(--success-color);
}

.form-text {
    color: var(--dark-color);
    font-size: 13px;
    margin-top: 6px;
}

.spinner-border {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-color);
}

.card-title {
    color: var(--dark-color);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.card-text {
    color: var(--dark-color);
    margin-bottom: 0;
    font-weight: 600;
}

.logo {
    max-width: 200px;
    height: auto;
}
