/* ==========================================================================
   ESPACE ADMINISTRATION CEEXDI (BACKOFFICE)
   Style moderne, professionnel, épuré, responsive
   ========================================================================== */

.admin-body {
    background-color: #f1f5f9;
    color: #1e293b;
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 270px;
    background: #11385d;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
}

.admin-brand {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-brand img {
    height: 42px;
    filter: brightness(1.2);
}

.admin-nav {
    padding: 1.5rem 0.75rem;
    flex-grow: 1;
    overflow-y: auto;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    color: #94a3b8;
    border-radius: var(--radius-sm);
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.admin-nav-item:hover, .admin-nav-item.active {
    background: rgba(0, 75, 147, 0.4);
    color: #ffffff;
}

.admin-nav-item.active {
    background: #004b93;
    box-shadow: 0 4px 12px rgba(0, 75, 147, 0.35);
}

.admin-nav-item svg {
    width: 20px;
    height: 20px;
}

.badge-count {
    margin-left: auto;
    background: #ea580c;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
}

.admin-main {
    margin-left: 270px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.admin-content {
    padding: 2rem;
    flex-grow: 1;
}

.admin-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    margin-bottom: 2rem;
}

.admin-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Widgets métriques */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: #03172e;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.metric-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
}

.metric-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-sm);
    background: #eff6ff;
    color: #004b93;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tables d'administration */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background: #f8fafc;
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

.admin-table tr:hover td {
    background: #f8fafc;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

.badge-active { background: #e8f7ee; color: #166534; }
.badge-inactive { background: #fef2f2; color: #991b1b; }
.badge-unread { background: #ffedd5; color: #9a3412; }
.badge-read { background: #f1f5f9; color: #475569; }

/* Mot de passe avec oeil */
.password-field-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 0.25rem;
}

.password-toggle-btn:hover {
    color: #0f172a;
}

/* WYSIWYG Editor */
.wysiwyg-wrapper {
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #ffffff;
}

.wysiwyg-toolbar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.wysiwyg-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: #334155;
    transition: var(--transition);
}

.wysiwyg-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.wysiwyg-content {
    min-height: 220px;
    padding: 1.25rem;
    outline: none;
    line-height: 1.7;
}

/* Modals personnalisés (interdiction alert/confirm - AI_RULES.md) */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 23, 46, 0.65);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 520px;
    padding: 2.2rem;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-backdrop.active .modal-card {
    transform: scale(1);
}

@media (max-width: 992px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
}

