:root{
    --app-border: rgba(148, 163, 184, 0.12);
    --app-border-strong: rgba(148, 163, 184, 0.18);
    --app-bg: #182135c7;
    --app-bg-soft: rgba(15, 23, 42, 0.35);
    --app-text: #e5e7eb;
    --app-accent: #3b82f6;
    --app-accent2: rgba(59,130,246,.22);
    --app-danger: rgba(245, 43, 43, 0.479);
    --app-danger2: rgba(220, 38, 38, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: #111827;
    color: #d1d5db;
}

a {
    text-decoration: none;
}

img[alt="Admin Badge"],
img[alt="Developer Badge"] {
    width: 17px;
    height: auto;
    vertical-align: middle;
}

::-webkit-scrollbar {
    width: 8px;
    background-color: rgb(44, 44, 44);
}

::-webkit-scrollbar-thumb {
    background-color: rgb(159, 159, 159);
    border-radius: 4px;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4rem;
    background: linear-gradient(90deg, #1e1835c7 0%, #182135c7 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 5px 7px rgba(0, 0, 0, 0.2);
}

.header-left {
    display: flex;
    align-items: center;
}

.header-left span {
    font-size: 12px;
    margin-left: 5px;
    color: rgb(200, 130, 250);
}

.site-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    height: 40px;
    width: 40px;
    border-radius: 9999px;
    border: 2px solid #4b5563;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Déconnexion bouton */
.logout-button {
    background-color: #dc2626;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.logout-button:hover {
    background-color: #b91c1c;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: linear-gradient(90deg, #1e1835c7 0%, #182135c7 100%);
    height: calc(100vh - 4rem);
    padding: 1rem;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 4rem;
    left: 0;
}

.navigation {
    margin-top: 5px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.menu-bottom {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.menu li a {
    margin: 10px 0 10px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #d1d5db;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.nav-link:hover {
    background-color: #5a158c;
    color: #ffffff;
    transform: translateX(5px);
}

.icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- Main Content --- */
.main-content {
    margin-left: 250px;
    margin-top: 4rem;
    width: calc(100% - 250px);
    max-width: calc(100% - 250px);
    min-width: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-wrap: nowrap;
    height: auto;
}

.main-content section {
    margin-bottom: 0;
}

.dev{
    position: fixed;
    bottom: 8px;
    right: 31px;
    text-align: center;
    font-size: 10px;
    color: #9ca3af;
    opacity: 0.7;
    margin: 0;
    pointer-events: none;
}

/* --- Popup Modal --- */
.app-modal-backdrop{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
    z-index: 1000;
}

.app-modal{
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
    z-index: 1001;
}

.app-modal.is-open,
.app-modal-backdrop.is-open{
    opacity: 1;
    pointer-events: auto;
}

.app-modal-card{
    width: min(860px, calc(100vw - 28px));
    background: rgb(17, 24, 39);
    border: 1px solid rgba(148,163,184,.20);
    border-radius: 14px;
    padding: 16px 16px 14px 16px;
}

.app-modal-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(148,163,184,.15);
}

.app-modal-head h3{
    margin:0;
    color: var(--app-text);
    font-size: 1.05rem;
    font-weight: 900;
}

.app-modal-head p{
    margin:6px 0 0 0;
    color: rgba(229,231,235,.75);
    font-size:.9rem;
}

.app-modal-close{
    border: 1px solid rgba(148,163,184,.20);
    background: rgba(15,23,42,.35);
    color: var(--app-text);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
}

.app-modal-close:hover{ background: rgba(15,23,42,.55); }
.app-modal-form{ padding-top: 14px; }

.app-form-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.app-field{ display:flex; flex-direction:column; gap:6px; }
.app-field-full{ grid-column: 1 / -1; }

.app-field label{
    color: var(--app-text);
    font-weight: 800;
    font-size: .92rem;
}

.app-field input,
.app-field select{
    width:100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--app-border-strong);
    background-color: var(--app-bg-soft);
    color: var(--app-text);
    outline: none;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.app-field input:focus,
.app-field select:focus{
    border-color: var(--app-accent);
    box-shadow: 0 0 0 2px var(--app-accent2);
    background-color: rgba(15,23,42,.55);
}

.app-modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    padding-top: 14px;
}

.app-form-error{
    margin-top: 10px;
    color: #fca5a5;
    font-weight: 700;
    min-height: 18px;
}

.app-btn{
    display:inline-flex;
    align-items:center;
    gap:10px;
    border: 1px solid var(--app-border-strong);
    background: rgba(15, 23, 42, 0.45);
    color: var(--app-text);
    padding: 10px 14px;
    border-radius: 10px;
    cursor:pointer;
    font-family:"Poppins", sans-serif;
    font-weight:700;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.app-btn:hover{
    border-color: rgba(148,163,184,.35);
    background: rgba(15,23,42,.55);
}

.app-btn-danger{
    border-color: var(--app-danger);
    background: var(--app-danger2);
}

.app-btn-danger:hover{
    border-color: rgba(220, 38, 38, 0.8);
    background: rgba(220, 38, 38, 0.35);
}

.app-btn:focus{
    outline:none;
    border-color: var(--app-accent);
    box-shadow: 0 0 0 2px var(--app-accent2);
}

.app-btn-primary{
    border-color: rgba(59,130,246,.55);
    background: rgba(59,130,246,.18);
}

.app-btn-primary:hover{
    background: rgba(59,130,246,.26);
    border-color: rgba(59,130,246,.8);
}

.app-btn-danger:focus{
    border-color: var(--app-accent);
    box-shadow: 0 0 0 2px var(--app-accent2);
}

.app-btn-ghost{
    background: transparent;
}

/* --- Pagniation --- */
.pagination {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.page-btn,
.page-num {
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #6c6983;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.25s ease;
}

.page-btn:hover,
.page-num:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.5);
    color: #e0e0ff;
}

.page-btn.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-num.is-active {
    font-weight: 700;
}

.page-ellipsis {
    opacity: 0.6;
    padding: 0 4px;
}