/*
|--------------------------------------------------------------------------
| Admin Modern — Cards
|--------------------------------------------------------------------------
| Composant global de cartes pour le thème admin clair.
| Dépend de admin-modern.css pour les variables de couleurs.
*/

/* =========================================================================
   Carte de base
   ========================================================================= */

.admin-modern .card {
    position: relative;
    overflow: hidden;

    display: flex;
    flex-direction: column;

    width: 100%;
    height: auto;

    color: var(--admin-text);
    background: #fffdf9;

    border: 1px solid #e7dccd;
    border-radius: 22px;

    box-shadow:
        0 12px 34px rgba(76, 61, 38, .08);

    transition:
        transform .24s ease,
        box-shadow .24s ease,
        border-color .24s ease;
}

.admin-modern .card:hover {
    transform: translateY(-3px);

    border-color: #ddcfba;

    box-shadow:
        0 18px 42px rgba(76, 61, 38, .12);
}



/* =========================================================================
   Header
   ========================================================================= */

.admin-modern .card-header {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    min-height: 62px;
    padding: 1.15rem 1.5rem;

    color: var(--admin-heading);

    background:
        linear-gradient(
            180deg,
            #fbf7ef 0%,
            #f6efdf 100%
        );

    border-bottom: 1px solid #e6dccb;
    border-radius: 21px 21px 0 0;
}

.admin-modern .card-header:first-child {
    border-radius: 21px 21px 0 0;
}

/* =========================================================================
   Body
   ========================================================================= */

.admin-modern .card-body {
    position: relative;
    z-index: 1;

    flex: 1 1 auto;

    padding: 1.5rem;

    color: var(--admin-text);
    background: #fffdf9;

    border-radius: 0 0 21px 21px;
}

/* Lorsqu'un footer existe, le body ne doit pas porter le rayon inférieur */
.admin-modern .card-body:has(+ .card-footer) {
    border-radius: 0;
}

/* =========================================================================
   Footer
   ========================================================================= */

.admin-modern .card-footer {
    position: relative;
    z-index: 1;

    padding: 1rem 1.5rem;

    color: var(--admin-muted);
    background: #faf6ef;

    border-top: 1px solid #ece3d6;
    border-radius: 0 0 21px 21px;
}

/* =========================================================================
   Titres et contenu
   ========================================================================= */

.admin-modern .card-title {
    margin: 0;

    color: var(--admin-heading);

    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.admin-modern .card-subtitle {
    margin-top: .3rem;

    color: var(--admin-muted);

    font-size: .82rem;
}

.admin-modern .card-text {
    color: var(--admin-muted);
    line-height: 1.65;
}

/* =========================================================================
   Cartes sans header
   ========================================================================= */

.admin-modern .card > .card-body:first-child:last-child {
    border-radius: 21px;
}

.admin-modern .card > .card-body:first-child:not(:last-child) {
    border-radius: 21px 21px 0 0;
}

/* =========================================================================
   Cartes interactives
   ========================================================================= */

.admin-modern a.card,
.admin-modern button.card,
.admin-modern .card.card-clickable {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.admin-modern a.card:hover,
.admin-modern button.card:hover,
.admin-modern .card.card-clickable:hover {
    color: inherit;
}

/* =========================================================================
   Variantes
   ========================================================================= */

/* Hero */
.admin-modern .card-admin-hero {
    background:
        linear-gradient(
            135deg,
            rgba(196, 154, 74, .12),
            transparent 62%
        ),
        #fffdf9;
    border-color: #e1d3bc;
    border-radius: 24px;
}

.admin-modern .card-admin-hero::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background:
        linear-gradient(
            180deg,
            var(--admin-gold),
            var(--admin-gold-dark)
        );
}

.admin-modern .card-admin-hero .card-body {
    padding: 1.7rem;
    border-radius: 23px;
}

/* Statistique */
.admin-modern .card-admin-stat {
    min-height: 118px;
}

.admin-modern .card-admin-stat .card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-modern .card-admin-stat-icon {
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    color: var(--admin-gold-dark);
    background: #fff6e5;
    border: 1px solid #ead4aa;
    border-radius: 14px;
}

.admin-modern .card-admin-stat-value {
    color: var(--admin-heading);
    font-size: 1.45rem;
    font-weight: 850;
    line-height: 1;
}

.admin-modern .card-admin-stat-label {
    margin-top: .3rem;
    color: var(--admin-muted);
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* Compacte */
.admin-modern .card-admin-compact .card-header {
    min-height: 52px;
    padding: .9rem 1.15rem;
}

.admin-modern .card-admin-compact .card-body {
    padding: 1.1rem;
}

/* Douce */
.admin-modern .card-admin-soft {
    background: #faf6ef;
    border-color: #eadfce;
    box-shadow: none;
}

.admin-modern .card-admin-soft:hover {
    transform: none;
    box-shadow: none;
}

/* Or */
.admin-modern .card-admin-gold {
    background:
        linear-gradient(
            145deg,
            rgba(196, 154, 74, .12),
            rgba(255, 253, 249, .98)
        );
    border-color: #dfcda9;
}

/* Vert */
.admin-modern .card-admin-green {
    background:
        linear-gradient(
            145deg,
            rgba(36, 90, 77, .07),
            rgba(255, 253, 249, .98)
        );
    border-color: #cfded8;
}

/* Danger doux */
.admin-modern .card-admin-danger {
    background: #fff5f3;
    border-color: #efd1cc;
}

/* =========================================================================
   Cartes dans une grille
   ========================================================================= */

.admin-modern .admin-card-grid {
    align-items: stretch;
}

.admin-modern .admin-card-grid > [class*="col-"] {
    display: flex;
}

.admin-modern .admin-card-grid > [class*="col-"] > .card {
    width: 100%;
}

/* =========================================================================
   Désactivation des anciens effets HUD
   ========================================================================= */

.admin-modern .card-arrow,
.admin-modern .card-arrow-top-left,
.admin-modern .card-arrow-top-right,
.admin-modern .card-arrow-bottom-left,
.admin-modern .card-arrow-bottom-right {
    display: none !important;
}

.admin-modern .card::after {
    pointer-events: none;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 767.98px) {
    .admin-modern .card {
        border-radius: 18px;
    }

    .admin-modern .card-header {
        min-height: 56px;
        padding: 1rem 1.1rem;
        border-radius: 17px 17px 0 0;
    }

    .admin-modern .card-body {
        padding: 1.1rem;
        border-radius: 0 0 17px 17px;
    }

    .admin-modern .card-footer {
        padding: .9rem 1.1rem;
        border-radius: 0 0 17px 17px;
    }

    .admin-modern .card-admin-hero {
        border-radius: 20px;
    }

    .admin-modern .card-admin-hero .card-body {
        padding: 1.25rem;
        border-radius: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-modern .card {
        transition: none;
    }
}

/* =========================================================
   ESPACEMENTS DES GRILLES ADMIN
   ========================================================= */

.admin-modern .admin-page .row {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

.admin-modern .admin-page .row + .row {
    margin-top: 0;
}

/* Grilles explicitement prévues pour des cartes égales */
.admin-modern .admin-card-grid,
.admin-modern .admin-kpi-grid {
    row-gap: 1.5rem;
}

.admin-modern .admin-card-grid > [class*="col-"],
.admin-modern .admin-kpi-grid > [class*="col-"] {
    display: flex;
}

.admin-modern .admin-card-grid > [class*="col-"] > .card,
.admin-modern .admin-kpi-grid > [class*="col-"] > .card {
    height: 100%;
}

/* Espace entre deux blocs de cartes indépendants */
.admin-modern .admin-page > .row:not(:last-child) {
    margin-bottom: .1rem;
}