:root {
    --tblr-primary: #7aab8a;
    --tblr-primary-rgb: 122, 171, 138;
    --tblr-primary-lt: #eaf3ed;
    --tblr-primary-lt-rgb: 234, 243, 237;
    --tblr-link-color: #7aab8a;
    --tblr-link-hover-color: #5c8f6e;
}

.btn-primary {
    --tblr-btn-bg: #7aab8a;
    --tblr-btn-border-color: #7aab8a;
    --tblr-btn-hover-bg: #5c8f6e;
    --tblr-btn-hover-border-color: #5c8f6e;
    --tblr-btn-active-bg: #4e7a5e;
}

.bg-primary { background-color: #7aab8a !important; }
.text-primary { color: #7aab8a !important; }
.border-primary { border-color: #7aab8a !important; }
.nav-link.active { color: #7aab8a !important; }

/* Sidebar (menu vertical) : lisibilité façon navbar-dark de Tabler */
.sidebar {
    width: 250px;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    background: #4e7a5e;
}

.sidebar-brand { color: #fff; }

/* Page layout: fixed sidebar on large screens; below 992px, a top bar opens the sidebar over the content. */
.app-layout {
    display: flex;
}

.app-main {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 250px;
}

.app-topbar {
    display: none;
}

@media (max-width: 991.98px) {
    .app-layout {
        flex-direction: column;
    }

    .app-main {
        margin-left: 0;
    }

    .app-topbar {
        display: flex;
        align-items: center;
        gap: .5rem;
        position: sticky;
        top: 0;
        z-index: 1030;
        padding: .5rem .75rem;
        background: #4e7a5e;
    }

    .app-topbar-toggle {
        color: #fff;
        background: transparent;
        border-color: rgba(255, 255, 255, .35);
    }

    .sidebar {
        z-index: 1040;
        visibility: hidden;
        transform: translateX(-100%);
        transition: transform .2s ease-in-out, visibility .2s;
    }

    .sidebar.is-open {
        visibility: visible;
        transform: none;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(0, 0, 0, .4);
    }

    .page-header .page-title {
        flex-wrap: wrap;
    }

    #calendar .fc .fc-header-toolbar {
        flex-wrap: wrap;
        gap: .5rem;
    }
}

@media (min-width: 992px) {
    .sidebar-backdrop {
        display: none;
    }
}

.sidebar-heading {
    color: rgba(255, 255, 255, .55);
    letter-spacing: .08em;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: .5rem .75rem;
    border-radius: var(--tblr-border-radius, .375rem);
    color: rgba(255, 255, 255, .82);
    font-weight: 500;
    text-decoration: none;
    transition: background-color .12s ease-in-out, color .12s ease-in-out;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
    background-color: rgba(255, 255, 255, .12);
    color: #fff;
}

.sidebar-link.active {
    background-color: rgba(255, 255, 255, .16);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--tblr-primary-lt, #eaf3ed);
}

.sidebar-link i {
    width: 1.25rem;
    text-align: center;
}

/* Cards de positionnement : lisibilité pour un public âgé (gros texte, cible large) */
.jury-card {
    transition: box-shadow .15s ease-in-out, transform .15s ease-in-out;
}

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

.jury-card .jury-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
}

.jury-card .jury-info {
    font-size: 1.05rem;
}

/* Overlay de chargement des iframes à contenu distant (DocuSign) — cf. loading.js */
.js-iframe-loading { min-height: 80vh; }
.iframe-loader {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--tblr-body-bg, #fff);
}

/* Flash de fin d'action posé par l'option `flash` du helper Loading (loading.js). */
.btn-success-flash {
    background-color: var(--tblr-success) !important;
    border-color: var(--tblr-success) !important;
    color: #fff !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-danger-flash {
    background-color: var(--tblr-danger) !important;
    border-color: var(--tblr-danger) !important;
    color: #fff !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Bootstrap draws a cross / check icon inside validated fields: the border colour and the feedback text are enough. */
.form-control.is-invalid,
.form-select.is-invalid,
.form-control.is-valid,
.form-select.is-valid {
    background-image: none !important;
    padding-right: 0.75rem !important;
}

/* Placeholder rows and fade-in set by Loading.skeleton / Loading.skeletonHtml (loading.js). */
.skeleton-bar {
    display: block;
    height: .7rem;
    border-radius: .35rem;
    background: linear-gradient(90deg, var(--tblr-border-color) 25%, var(--tblr-bg-surface-secondary, #f6f8fb) 45%, var(--tblr-border-color) 65%);
    background-size: 300% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}
.skeleton-stack { display: flex; flex-direction: column; gap: .9rem; padding: .6rem 0; text-align: left; }
.skeleton-row td { padding-top: .85rem; padding-bottom: .85rem; }
.skeleton-w0 { width: 72%; }
.skeleton-w1 { width: 48%; }
.skeleton-w2 { width: 86%; }
.skeleton-w3 { width: 60%; }
.skeleton-w4 { width: 38%; }
.skeleton-w5 { width: 66%; }
.loading-reveal { animation: loading-reveal .45s ease both; }
@keyframes skeleton-shimmer {
    from { background-position: 100% 0; }
    to   { background-position: 0 0; }
}
@keyframes loading-reveal {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .skeleton-bar, .loading-reveal { animation: none; }
}
