/* =====================================================
   PORTAIL ESPACE RESSOURCES IFE — Style dédié
   Séparé du style.css de la bibliothèque
   ===================================================== */

:root {
    --ife-navy: #1B2A4A;
    --ife-navy-dark: #101B30;
    --ife-navy-light: #2E4272;
    --ife-sage: #5C8374;
    --ife-sage-dark: #47695D;
    --ife-sage-light: #E7EFEA;
    --ife-bg: #F5F6F3;
    --ife-white: #FFFFFF;
    --ife-text: #22262B;
    --ife-muted: #6B7280;
    --ife-border: #E1E4E8;
    --ife-radius: 14px;
}

body {
    background: var(--ife-bg);
    color: var(--ife-text);
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Barre supérieure ---------- */
.ife-topbar {
    background: var(--ife-navy);
    padding: 0.9rem 0;
}
.ife-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ife-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}
.ife-brand-mark {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    color: var(--ife-navy);
    background: var(--ife-sage-light);
    border-radius: 8px;
    padding: 0.15rem 0.5rem;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}
.ife-brand-text {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    color: #fff;
    font-size: 1.05rem;
}
.ife-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #fff;
    font-size: 0.9rem;
}
.ife-logout {
    color: var(--ife-sage-light);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.ife-logout:hover {
    border-bottom-color: var(--ife-sage-light);
}

/* ---------- Zone principale ---------- */
.ife-main {
    flex: 1;
    display: block;
    padding: 4rem 1rem 3rem;
}

/* ---------- Responsive : mobile / petites tablettes ---------- */
@media (max-width: 600px) {
    .ife-topbar-inner {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }
    .ife-user {
        font-size: 0.8rem;
        gap: 0.6rem;
    }
    .ife-brand-text {
        font-size: 0.95rem;
    }
    .ife-main {
        padding: 2rem 0.9rem 2.5rem;
    }
}

/* ---------- Page de connexion ---------- */
.ife-login-wrap {
    max-width: 860px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 2rem;
    align-items: start;
    width: 100%;
}
@media (max-width: 768px) {
    .ife-login-wrap { grid-template-columns: 1fr; }
}

.ife-login-card {
    background: var(--ife-white);
    border: 1px solid var(--ife-border);
    border-radius: var(--ife-radius);
    padding: 2.5rem;
    box-shadow: 0 1px 3px rgba(27, 42, 74, 0.06);
}

.ife-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ife-sage-dark);
    margin-bottom: 0.4rem;
}

/* ---------- Lien de retour ---------- */
.ife-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--ife-muted);
    font-size: 0.85rem;
    text-decoration: none;
    margin-top: 0.3rem;
}
.ife-back-link:hover {
    color: var(--ife-navy);
    text-decoration: underline;
}

/* ---------- Liens vers d'autres fonctionnalités (plus visibles qu'un simple retour) ---------- */
.ife-page-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.ife-page-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--ife-sage-light);
    color: var(--ife-sage-dark);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}
.ife-page-links a:hover {
    background: var(--ife-sage);
    color: #fff;
}
.ife-page-links a.ife-page-link-retour {
    background: transparent;
    color: var(--ife-muted);
    padding-left: 0;
}
.ife-page-links a.ife-page-link-retour:hover {
    background: transparent;
    color: var(--ife-navy);
    text-decoration: underline;
}
.ife-login-title {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 2rem;
    color: var(--ife-navy);
    margin-bottom: 0.4rem;
}
.ife-login-sub {
    color: var(--ife-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.ife-form .form-label {
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--ife-text);
}
.ife-form .form-control {
    border-radius: 8px;
    border-color: var(--ife-border);
    padding: 0.6rem 0.8rem;
}
.ife-form .form-control:focus {
    border-color: var(--ife-sage);
    box-shadow: 0 0 0 0.2rem rgba(92, 131, 116, 0.15);
}

.ife-btn-primary {
    background: var(--ife-navy);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    font-weight: 600;
    transition: background 0.15s ease;
}
.ife-btn-primary:hover {
    background: var(--ife-navy-light);
    color: #fff;
}

/* ---------- Aperçu des espaces (page de connexion) ---------- */
.ife-spaces-preview {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding-top: 0.5rem;
}
.ife-spaces-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ife-muted);
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.ife-space-tile {
    background: var(--ife-white);
    border: 1px solid var(--ife-border);
    border-left: 4px solid var(--ife-border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}
.ife-space-tile.ife-space-active {
    border-left-color: var(--ife-sage);
}
.ife-space-name {
    font-weight: 600;
    color: var(--ife-navy);
}
.ife-space-status {
    font-size: 0.75rem;
    color: var(--ife-muted);
}
.ife-space-active .ife-space-status {
    color: var(--ife-sage-dark);
    font-weight: 600;
}

/* ---------- Pied de page ---------- */
.ife-footer {
    padding: 1.2rem 0;
    text-align: center;
    color: var(--ife-muted);
    font-size: 0.8rem;
}

/* ---------- Menu après connexion (utilisé par menu.php) ---------- */
.ife-menu-intro {
    max-width: 900px;
    margin: 0 auto 1.75rem;
    width: 100%;
}
.ife-menu-intro h1 {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    color: var(--ife-navy);
}
.ife-menu-intro p {
    color: var(--ife-muted);
}
.ife-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}
.ife-menu-card {
    background: var(--ife-white);
    border: 1px solid var(--ife-border);
    border-radius: var(--ife-radius);
    padding: 1.75rem;
    text-decoration: none;
    color: var(--ife-text);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: block;
}
.ife-menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(27, 42, 74, 0.1);
    color: var(--ife-text);
}
.ife-menu-card-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--ife-navy);
    margin-bottom: 0.4rem;
}
.ife-menu-card-desc {
    color: var(--ife-muted);
    font-size: 0.9rem;
}
.ife-menu-card.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* ---------- Emprunts ---------- */
.ife-section-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--ife-navy);
    margin: 2rem 0 0.9rem;
}
.ife-empty {
    color: var(--ife-muted);
    font-size: 0.9rem;
    font-style: italic;
}
.ife-emprunt-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.ife-emprunt-card {
    background: var(--ife-white);
    border: 1px solid var(--ife-border);
    border-left: 4px solid var(--ife-sage);
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.ife-emprunt-retard {
    border-left-color: #B3441E;
    background: #FBF2EE;
}
.ife-emprunt-attente {
    border-left-color: #C68A1F;
    background: #FDF6E8;
}
.ife-emprunt-historique {
    opacity: 0.75;
}
.ife-emprunt-titre {
    font-weight: 600;
    color: var(--ife-navy);
    font-size: 0.95rem;
}
.ife-emprunt-meta {
    color: var(--ife-muted);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}
.ife-emprunt-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
/* =====================================================
   BANDEAU DE NOTIFICATION (demandes d'emprunt en attente)
   ===================================================== */
.ife-notif-banniere {
    background: var(--ife-sage-light);
    border-bottom: 1px solid var(--ife-sage);
}
.ife-notif-banniere-inner {
    padding: 0.65rem 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--ife-sage-dark);
    font-weight: 600;
}
.ife-notif-banniere-lien {
    color: var(--ife-navy);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.ife-notif-banniere-lien:hover {
    text-decoration: underline;
}
/* =====================================================
   TABLEAU DE BORD
   ===================================================== */
.ife-dash-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}
.ife-dash-kpi {
    display: block;
    text-decoration: none;
    border-radius: 12px;
    padding: 1.1rem 1.3rem;
    border: 1px solid var(--ife-border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ife-dash-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(27, 42, 74, 0.1);
}
.ife-dash-kpi-nb {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1;
}
.ife-dash-kpi-label {
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 0.4rem;
}

.ife-dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.1rem;
}
.ife-dash-card {
    display: block;
    text-decoration: none;
    border-radius: 12px;
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--ife-border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    color: var(--ife-text);
}
.ife-dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(27, 42, 74, 0.1);
    color: var(--ife-text);
}
.ife-dash-card-icon {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}
.ife-dash-card-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ife-navy);
    margin-bottom: 0.3rem;
}
.ife-dash-card-desc {
    color: var(--ife-muted);
    font-size: 0.85rem;
}

/* Palette de couleurs d'accent pour les KPI et cartes */
.ife-dash-kpi--sage, .ife-dash-card--sage { background: #E7EFEA; border-color: #C7DBCF; }
.ife-dash-kpi--sage .ife-dash-kpi-nb, .ife-dash-kpi--sage .ife-dash-kpi-label { color: var(--ife-sage-dark); }

.ife-dash-kpi--navy, .ife-dash-card--navy { background: #E7EAF0; border-color: #C5CCDE; }
.ife-dash-kpi--navy .ife-dash-kpi-nb, .ife-dash-kpi--navy .ife-dash-kpi-label { color: var(--ife-navy); }

.ife-dash-kpi--terracotta, .ife-dash-card--terracotta { background: #FBEEE8; border-color: #F0CFC0; }
.ife-dash-kpi--terracotta .ife-dash-kpi-nb, .ife-dash-kpi--terracotta .ife-dash-kpi-label { color: #B3441E; }

.ife-dash-kpi--amber, .ife-dash-card--amber { background: #FDF3E0; border-color: #F2DBA6; }
.ife-dash-kpi--amber .ife-dash-kpi-nb, .ife-dash-kpi--amber .ife-dash-kpi-label { color: #92610C; }

.ife-dash-kpi--blue, .ife-dash-card--blue { background: #E7F0F7; border-color: #BFDBEC; }
.ife-dash-kpi--blue .ife-dash-kpi-nb, .ife-dash-kpi--blue .ife-dash-kpi-label { color: #2A5C7D; }

.ife-dash-kpi--purple, .ife-dash-card--purple { background: #EFE9F5; border-color: #D6C5E8; }
.ife-dash-kpi--purple .ife-dash-kpi-nb, .ife-dash-kpi--purple .ife-dash-kpi-label { color: #6B3FA0; }

.ife-dash-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
}
.ife-dash-section-head .ife-section-title {
    margin: 0;
}

/* ---------- En-tête de section coloré (icône + fond teinté) ---------- */
.ife-section-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-radius: 12px;
    padding: 0.9rem 1.2rem;
    margin: 2rem 0 1rem;
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.05rem;
}
.ife-section-card:first-child {
    margin-top: 0;
}
.ife-section-card-icon {
    font-size: 1.3rem;
    line-height: 1;
}
.ife-section-card-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    padding: 0.1rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 700;
}
.ife-section-card--amber { background: #FDF3E0; color: #92610C; }
.ife-section-card--sage { background: #E7EFEA; color: var(--ife-sage-dark); }
.ife-section-card--navy { background: #E7EAF0; color: var(--ife-navy); }
.ife-section-card--muted { background: #F1F1EF; color: var(--ife-muted); }