body {
    margin: 0
}

.aej {
    --bg: #faf8f5;
    --surface: #ffffff;
    --sunken: #f3efea;
    --line: #ece7e1;
    --line-c: #8a8076;
    --ink: #1e1b18;
    --muted: #6b635b;
    --action: #b85200;
    --on-action-soft: #9a5000;
    --action-soft: #fff1e0;
    --success: #1f7a2b;
    --success-soft: #e8f5e9;
    --danger: #b3382a;
    --danger-soft: #fbeae6;
    font-family: "Plus Jakarta Sans", system-ui, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased
}

.aej * {
    box-sizing: border-box
}

.aej button,
.aej input {
    font: inherit;
    color: inherit
}

.aej button {
    cursor: pointer
}

.aej a {
    color: var(--action);
    text-decoration: none
}

.aej a:hover {
    text-decoration: underline
}

.aej :focus-visible {
    outline: 2px solid var(--action);
    outline-offset: 2px
}

.aej .login-hero {
    background-color: #16213a;
    background-image: linear-gradient(180deg, rgba(13, 17, 34, .25) 0%, rgba(13, 17, 34, .55) 55%, rgba(13, 17, 34, .92) 100%), url(/images/banniere-aej.svg);
    background-size: cover;
    background-position: 60% 50%
}

.aej .pcard {
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease
}

.aej .pcard:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 40px -22px rgba(30, 27, 24, .45)
}

.aej input::placeholder {
    color: #8a8076
}

/* Espace connecté */
.aej .app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface);
    border-bottom: 1px solid var(--line)
}

.aej .app-nav {
    max-width: 1040px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px
}

.aej .app-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700
}

.aej .app-nav-link {
    padding: 8px 12px;
    border-radius: 10px;
    border: 0;
    background: none;
    color: var(--muted);
    font-weight: 700
}

.aej .app-nav-link:hover {
    background: var(--sunken);
    color: var(--ink);
    text-decoration: none
}

.aej .app-nav-link.is-active {
    background: var(--action-soft);
    color: var(--on-action-soft)
}

.aej .app-main {
    max-width: 1040px;
    margin: 0 auto;
    padding: 40px 24px 64px
}

.aej .page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--action)
}

.aej .page-eyebrow::before {
    content: "";
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: currentColor
}

.aej .page-title {
    margin: 10px 0 0;
    font-size: 32px;
    line-height: 40px;
    font-weight: 800;
    letter-spacing: -0.02em
}

.aej .page-lead {
    margin: 8px 0 0;
    font-size: 16px;
    color: var(--muted)
}

.aej .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 18px 36px -30px rgba(30, 27, 24, .35)
}

.aej .card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800
}

.aej .card-text {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 22px;
    color: var(--muted)
}

.aej .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800
}

.aej .badge-success {
    background: var(--success-soft);
    color: var(--success)
}

.aej .input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--line-c);
    border-radius: 14px;
    background: var(--surface);
    padding: 0 16px;
    font-size: 16px
}

.aej .btn {
    height: 52px;
    padding: 0 22px;
    border: 0;
    border-radius: 14px;
    font-weight: 800;
    font-size: 15px;
    white-space: nowrap
}

.aej .btn-primary {
    background: linear-gradient(135deg, #d96a10, #b85200);
    color: #ffffff;
    box-shadow: 0 14px 28px -14px rgba(0, 0, 0, .45)
}

.aej .btn-secondary {
    background: var(--sunken);
    color: var(--ink);
    border: 1px solid var(--line)
}

.aej .btn-danger {
    background: var(--danger);
    color: #ffffff
}

.aej .btn:hover {
    filter: brightness(.95)
}

.aej .field-error {
    margin: 12px 0 0;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 14px;
    font-weight: 600
}


/* Gestion des utilisateurs */
.aej .page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px
}

.aej .btn-link {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    text-decoration: none
}

.aej .btn-link:hover {
    text-decoration: none
}

.aej .table-wrap {
    padding: 0
}

.aej .table thead th:first-child {
    border-top-left-radius: 20px
}

.aej .table thead th:last-child {
    border-top-right-radius: 20px
}

@media (max-width: 720px) {
    .aej .table-wrap {
        overflow-x: auto
    }
}

.aej .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px
}

.aej .table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--sunken);
    border-bottom: 1px solid var(--line)
}

.aej .table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle
}

.aej .table tr:last-child td {
    border-bottom: 0
}

.aej .badge-muted {
    background: var(--sunken);
    color: var(--muted)
}

.aej .badge-danger {
    background: var(--danger-soft);
    color: var(--danger)
}

.aej .badge-action {
    background: var(--action-soft);
    color: var(--on-action-soft)
}

.aej .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    font-weight: 700
}

.aej .field-hint {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted)
}

.aej .field-message {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--danger)
}

.aej select.input {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    padding-right: 40px
}

.aej .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px
}

.aej .check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px
}

.aej .check-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    cursor: pointer
}

.aej .check-card:has(input:checked) {
    border-color: var(--action);
    background: var(--action-soft)
}

.aej .check-card input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--action)
}

.aej .pagination-wrap {
    margin-top: 20px
}


/* Menu d'actions et permissions */
.aej .action-menu {
    position: relative;
    display: inline-block;
    text-align: left
}

.aej .action-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    font-size: 14px;
    list-style: none;
    cursor: pointer
}

.aej .action-menu summary::-webkit-details-marker {
    display: none
}

.aej .action-menu-list {
    position: absolute;
    right: 0;
    z-index: 20;
    min-width: 220px;
    margin-top: 6px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 22px 40px -22px rgba(30, 27, 24, .45)
}

.aej .action-menu-list a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700
}

.aej .action-menu-list a:hover {
    background: var(--action-soft);
    color: var(--on-action-soft);
    text-decoration: none
}

.aej .role-card:not(:has(input:checked)) {
    border-style: dashed;
    border-color: var(--danger);
    background: var(--danger-soft)
}

.aej .role-card:not(:has(input:checked)) > span > span:first-child {
    text-decoration: line-through;
    color: var(--danger)
}

.aej .role-card .role-card-hint-off,
.aej .role-card:not(:has(input:checked)) .role-card-hint-on {
    display: none
}

.aej .role-card:not(:has(input:checked)) .role-card-hint-off {
    display: block;
    color: var(--danger)
}
