/* ==========
   Layout global
   ========== */

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #4b5563;
    background-color: #f8f9fc;
}

/* Wrapper principal (sidebar + contenu) */

#wrapper {
    display: flex;
    min-height: 100vh;
}

/* ==========
   Sidebar
   ========== */

.sidebar {
    width: 240px;
    background: #4e73df; /* Bleu style SB Admin 2 */
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0 1.25rem 1rem;
}

.sidebar-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    margin: 0 1.25rem 0.75rem;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-weight: 600;
}

/* ==========
   Contenu principal
   ========== */

#content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */

.topbar {
    height: 56px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-title {
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
}

.topbar-user {
    font-size: 0.875rem;
    color: #4b5563;
}

/* Zone principale */

.main-content {
    padding: 1.5rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 2rem auto;
}

/* En-têtes de page */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #111827;
}

.page-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Cartes génériques */

.card-custom {
    background-color: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.card-custom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.card-custom-title {
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}

.card-custom-body {
    font-size: 0.9rem;
}

/* Compteurs du dashboard */

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111827;
}

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Bouton rond (recherche etc.) */

.input-pill {
    border-radius: 999px !important;
}

/* Liste des rappels */

.reminder-list li {
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
}

.reminder-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    margin-right: 0.5rem;
    margin-top: 0.3rem;
    flex-shrink: 0;
}

.reminder-dot.red {
    background-color: #dc2626;
}
.reminder-dot.orange {
    background-color: #f97316;
}
reminder-dot.green {
    background-color: #16a34a;
}

/* Tableaux */

.table thead th {
    border-bottom-width: 2px;
    border-color: #e5e7eb !important;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}

.table-hover tbody tr:hover {
    background-color: #f9fafb;
}

/* ==========
   Login
   ========== */

.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #1d4ed8 0, #111827 55%, #020617 100%);
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background-color: rgba(15, 23, 42, 0.96);
    color: #e5e7eb;
    border-radius: 1rem;
    padding: 2rem 1.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
}

.login-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

/* ==========
   Responsive
   ========== */

@media (max-width: 992px) {

    #wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 0.5rem 0.75rem;
        border-bottom: 1px solid rgba(15, 23, 42, 0.7);
    }

    .sidebar-brand {
        padding: 0 0.5rem 0.35rem;
        margin-bottom: 0.25rem;
    }

    .sidebar-divider {
        display: none;
    }

    .sidebar-nav {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.25rem;
        padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    }

    .sidebar-nav li {
        margin-bottom: 0;
    }

    .sidebar-link {
        border-radius: 999px;
        padding: 0.35rem 0.8rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .topbar {
        padding: 0.5rem 0.75rem;
    }

    .main-content {
        padding: 1rem 0.75rem;
    }
}

@media (max-width: 576px) {

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header .d-flex.gap-2 {
        width: 100%;
        flex-wrap: wrap;
    }

    .page-header .d-flex.gap-2 .btn {
        flex: 1 0 auto;
    }

    .card-custom-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .login-card {
        padding: 1.75rem 1.25rem;
    }
}
