/* ============================================================
   IDENTITY — CSS
   Back-office IAM : Indigo / Slate / Outfit
   Pages publiques  : Cormorant Garamond / DM Sans / bg2.png
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;600&family=DM+Sans:wght@300;400;500&display=swap');

:root {
    --primary:          #4f46e5;
    --primary-dark:     #3730a3;
    --primary-hover:    #4338ca;
    --primary-light:    #eef2ff;
    --danger:           #dc2626;
    --danger-hover:     #b91c1c;
    --danger-light:     #fef2f2;
    --success:          #059669;
    --success-light:    #ecfdf5;
    --warning:          #d97706;
    --warning-light:    #fffbeb;
    --info:             #0284c7;
    --info-light:       #f0f9ff;

    --navbar-bg:        #1e1b4b;
    --navbar-text:      #e0e7ff;

    --bg:               #f1f5f9;
    --surface:          #ffffff;
    --border:           #e2e8f0;
    --border-strong:    #cbd5e1;
    --text:             #0f172a;
    --text-muted:       #64748b;

    --radius:           8px;
    --radius-sm:        4px;
    --shadow:           0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.07);
    --shadow-md:        0 4px 16px rgba(0,0,0,.10);
    --transition:       .15s ease;
    --navbar-height:    58px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
code {
    font-family: 'DM Mono', monospace;
    font-size: .85em;
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--primary-dark);
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
    position: sticky; top: 0; z-index: 100;
    height: var(--navbar-height);
    background: var(--navbar-bg);
    display: flex; align-items: center; gap: 1.5rem;
    padding: 0 1.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.navbar-brand {
    display: flex; align-items: center; gap: .6rem;
    color: #fff;
    font-weight: 600; font-size: 1.05rem;
    flex-shrink: 0;
}
.navbar-icon  { font-size: 1.3rem; color: #a5b4fc; }
.navbar-name  { letter-spacing: .03em; }
.navbar-nav   { display: flex; gap: .2rem; flex: 1; }
.navbar-user  { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }

.nav-link {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .4rem .85rem;
    border-radius: var(--radius-sm);
    color: var(--navbar-text);
    font-weight: 500; font-size: .875rem;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}
.nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.15); color: #fff; }
.nav-logout:hover { background: rgba(220,38,38,.3); color: #fca5a5; }

.user-name {
    color: #c7d2fe;
    font-size: .8rem;
    display: flex; align-items: center; gap: .35rem;
}
.badge-iam {
    background: #818cf8;
    color: #fff;
    font-size: .65rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: .05em;
}

/* ── Contenu principal ──────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 2rem 1.75rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
    padding: .75rem 1.75rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .75rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* ── Page header ────────────────────────────────────────────── */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}
.page-title {
    font-size: 1.35rem; font-weight: 600; color: var(--text);
    display: flex; align-items: center; gap: .5rem;
}
.page-title i { color: var(--primary); }
.page-sub { color: var(--text-muted); font-size: .85rem; margin-top: .2rem; }

/* ── Cartes ─────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.card-title {
    font-size: .95rem; font-weight: 600; color: var(--text);
    display: flex; align-items: center; gap: .4rem;
}
.card-body { padding: 1.25rem; }
.card-search { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }

/* ── Boutons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: .875rem; font-weight: 500;
    cursor: pointer; white-space: nowrap;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    text-decoration: none;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-primary   { background: var(--primary);   color: #fff; border-color: var(--primary);   }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

.btn-secondary { background: #475569; color: #fff; border-color: #475569; }
.btn-secondary:hover { background: #334155; border-color: #334155; color: #fff; }

.btn-success   { background: var(--success);   color: #fff; border-color: var(--success);   }
.btn-success:hover { background: #047857; border-color: #047857; color: #fff; }

.btn-danger    { background: var(--danger);    color: #fff; border-color: var(--danger);    }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: #fff; }

.btn-warning   { background: var(--warning);   color: #fff; border-color: var(--warning);   }
.btn-warning:hover { background: #b45309; border-color: #b45309; color: #fff; }

.btn-outline {
    background: transparent; color: var(--text);
    border-color: var(--border-strong);
}
.btn-outline:hover { background: #f1f5f9; border-color: var(--text-muted); color: var(--text); }

.btn-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 1.1rem;
    padding: .2rem .4rem; border-radius: 3px;
    transition: color var(--transition);
}
.btn-close:hover { color: var(--danger); }

/* ── Alertes ─────────────────────────────────────────────────── */
.alert {
    display: flex; align-items: flex-start; gap: .6rem;
    padding: .85rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: .875rem;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-light); border-color: #a7f3d0; color: #065f46; }
.alert-danger  { background: var(--danger-light);  border-color: #fecaca; color: #991b1b; }
.alert-warning { background: var(--warning-light); border-color: #fde68a; color: #92400e; }
.alert-info    { background: var(--info-light);    border-color: #bae6fd; color: #075985; }

.token-alert { flex-direction: column; gap: .5rem; }
.token-alert-header { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.token-url-wrap {
    display: flex; align-items: center; gap: .5rem;
    background: #fff; border: 1px solid #bae6fd;
    border-radius: var(--radius-sm); padding: .4rem .75rem;
}
.token-url { word-break: break-all; font-size: .8rem; flex: 1; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 7px;
    font-size: .72rem; font-weight: 600;
    border-radius: 99px;
    white-space: nowrap;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger);  }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info);    }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.ms-auto { margin-left: auto; }

/* ── Formulaires ─────────────────────────────────────────────── */
.form-group  { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .85rem; }
.form-label  { font-size: .8rem; font-weight: 600; color: var(--text); }
.form-control {
    padding: .5rem .75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit; font-size: .875rem;
    color: var(--text); background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.form-control::placeholder { color: #94a3b8; }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
    align-items: end;
}
.form-group-email { min-width: 200px; }
.form-actions { display: flex; gap: .5rem; align-items: center; margin-top: .25rem; }
.form-actions-inline { justify-content: flex-start; margin-top: 0; align-self: flex-end; }
.form-check-wrap { flex-direction: row; align-items: center; }
.form-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .875rem; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.required { color: var(--danger); }

.input-icon-wrap { position: relative; }
.input-icon {
    position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 1rem; pointer-events: none;
}
.input-icon-wrap .form-control { padding-left: 2.2rem; }

.password-rules {
    background: #f8fafc; border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: .75rem 1rem;
    margin-bottom: .85rem; font-size: .8rem;
}
.rules-title { font-weight: 600; margin-bottom: .35rem; }
.password-rules ul { padding-left: 1.25rem; }
.password-rules li { margin-bottom: .15rem; color: var(--text-muted); }

/* ── Barre de recherche ──────────────────────────────────────── */
.search-bar {
    display: flex; align-items: center; gap: .5rem;
    margin-bottom: 1rem;
}
.search-bar-inline { margin-bottom: 0; }
.search-bar .input-icon-wrap { flex: 1; }

/* ── Panel (create form toggle) ──────────────────────────────── */
.panel { margin-bottom: 1rem; }
.panel-hidden { display: none; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.table th {
    padding: .65rem 1rem;
    text-align: left;
    font-size: .75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafafa; }
.table tbody tr.row-inactive td { opacity: .6; }

.th-actions { text-align: right; min-width: 240px; }
.td-actions { text-align: right; white-space: nowrap; }
.th-app     { text-align: center; min-width: 100px; }

/* Table d'accès */
.table-access .td-access { text-align: center; }
.btn-access {
    width: 32px; height: 32px;
    border: none; border-radius: 50%;
    cursor: pointer; font-size: 1.1rem;
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform var(--transition), opacity var(--transition);
    background: none; padding: 0;
}
.btn-access:hover { transform: scale(1.15); }
.btn-access-granted { color: var(--success); }
.btn-access-granted:hover { color: var(--danger); }
.btn-access-denied  { color: #cbd5e1; }
.btn-access-denied:hover  { color: var(--success); }

/* ── Lignes d'édition inline ─────────────────────────────────── */
.edit-row td { background: var(--primary-light); padding: .75rem 1rem; }
.edit-form .form-row { align-items: flex-end; }

/* ── Applications grid ───────────────────────────────────────── */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}
.app-card-inactive { border-left-color: var(--danger); opacity: .7; }
.app-card-header {
    display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem;
}
.app-icon {
    width: 40px; height: 40px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: var(--primary);
    flex-shrink: 0;
}
.app-label { font-weight: 600; font-size: .95rem; }
.app-slug  { font-size: .75rem; color: var(--text-muted); }
.app-card-stats {
    display: flex; flex-direction: column; gap: .3rem;
    font-size: .8rem; color: var(--text-muted);
}
.app-url { font-size: .75rem; color: var(--info); word-break: break-all; }

/* ── User display ────────────────────────────────────────────── */
.user-fullname { font-weight: 500; }
.uuid-short { font-size: .72rem; color: var(--text-muted); }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
    display: flex; align-items: center; justify-content: center;
    gap: .75rem; margin-top: 1.25rem;
}
.pagination-info { color: var(--text-muted); font-size: .875rem; }

/* ── Utilitaires ─────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }

/* ── PAGES PUBLIQUES — style conforme SecureMsg ──────────────── */

/* Variables spécifiques aux pages publiques */
.public-page {
    --pub-accent:       #8b7355;
    --pub-accent-light: #c9a96e;
    --pub-text:         #1a1a2e;
    --pub-text-muted:   #9090a8;
    --pub-bg-card:      rgba(255,255,255,0.97);
    --pub-border:       #e2e0db;
    --pub-shadow:       0 20px 60px rgba(0,0,0,0.28);
    --pub-radius:       12px;
    --pub-radius-sm:    6px;
    font-family: 'DM Sans', system-ui, sans-serif;
    color: var(--pub-text);
    background: #0f1117;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    padding-top: 0 !important;  /* annule le padding-top back-office */
}

/* Fond d'écran plein écran fixe */
.pub-bg {
    position: fixed;
    inset: 0;
    background: url('/assets/images/bg2.png') center center / cover no-repeat;
    z-index: 0;
}
.pub-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(8,10,18,0.48);
    pointer-events: none;
}

/* Wrapper principal */
.pub-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* Positionnement de la carte — alignée à gauche (padding 6rem) */
.pub-card-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem 2rem 2rem 6rem;
}

/* Carte principale */
.pub-card {
    width: 100%;
    max-width: 460px;
    background: var(--pub-bg-card);
    border-radius: var(--pub-radius);
    box-shadow: var(--pub-shadow);
    overflow: hidden;
    animation: pubFadeUp .6s ease both;
}

/* Barre de couleur en haut de la carte */
.pub-card-accent {
    height: 4px;
    background: linear-gradient(90deg, var(--pub-accent), var(--pub-accent-light));
}
.pub-card-accent--danger  { background: linear-gradient(90deg, #9b2226, #c0392b); }
.pub-card-accent--warning { background: linear-gradient(90deg, #7f4f24, #d97706); }

/* Variantes d'icône */
.pub-icon--danger  { background: linear-gradient(135deg, #9b2226, #c0392b); }
.pub-icon--warning { background: linear-gradient(135deg, #7f4f24, #d97706); }

/* En-tête de carte */
.pub-card-header {
    padding: 2.5rem 2.5rem 0;
    text-align: center;
}

/* Icône circulaire */
.pub-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--pub-accent), var(--pub-accent-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pub-icon svg {
    width: 26px; height: 26px;
    stroke: #fff; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Titres */
.pub-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--pub-text);
    letter-spacing: -.02em;
    margin-bottom: .25rem;
    line-height: 1.2;
}
.pub-subtitle {
    font-size: .82rem;
    color: var(--pub-text-muted);
    margin-bottom: 1.75rem;
}

/* Corps de carte */
.pub-card-body {
    padding: .25rem 2.5rem 2.5rem;
}

/* Pied de carte */
.pub-card-footer {
    padding: 1rem 2.5rem;
    text-align: center;
    background: rgba(250,249,247,.6);
    border-top: 1px solid var(--pub-border);
    font-size: .75rem;
    color: var(--pub-text-muted);
}

/* Inputs sur pages publiques */
.pub-card .form-group { margin-bottom: 1.25rem; }
.pub-card .form-label {
    display: block;
    font-size: .78rem;
    font-weight: 500;
    color: #5a5a72;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .45rem;
}
.pub-card .form-control {
    width: 100%;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: .95rem;
    color: var(--pub-text);
    background: #fafafa;
    border: 1px solid var(--pub-border);
    border-radius: var(--pub-radius-sm);
    padding: .75rem 1rem .75rem 2.4rem;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    -webkit-appearance: none;
}
.pub-card .form-control:focus {
    border-color: var(--pub-accent);
    box-shadow: 0 0 0 3px rgba(139,115,85,.12);
    background: #fff;
}
.pub-card .form-control::placeholder { color: #b0b0c8; }
.pub-card .input-icon-wrap { position: relative; }
.pub-card .input-icon {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pub-accent);
    font-size: 1rem;
    pointer-events: none;
}

/* Bouton principal sur pages publiques */
.pub-card .btn-primary {
    background: linear-gradient(135deg, var(--pub-accent), var(--pub-accent-light));
    color: #fff;
    border: none;
    border-radius: var(--pub-radius-sm);
    box-shadow: 0 4px 12px rgba(139,115,85,.35);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: .9rem;
    font-weight: 500;
    padding: .85rem 1.75rem;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    text-decoration: none;
}
.pub-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(139,115,85,.45);
    color: #fff;
}
.pub-card .btn-outline {
    background: transparent;
    color: var(--pub-accent);
    border: 1px solid var(--pub-accent);
    border-radius: var(--pub-radius-sm);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: .9rem;
    font-weight: 500;
    padding: .75rem 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    cursor: pointer;
    transition: background .2s, color .2s;
    text-decoration: none;
}
.pub-card .btn-outline:hover {
    background: var(--pub-accent);
    color: #fff;
}

/* Alertes sur pages publiques */
.pub-card .alert {
    padding: .8rem 1rem;
    border-radius: var(--pub-radius-sm);
    font-size: .88rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    line-height: 1.5;
}
.pub-card .alert-danger  { background: #fde8e8; color: #9b2226; border: 1px solid rgba(155,34,38,.2); }
.pub-card .alert-success { background: #d8f3dc; color: #2d6a4f; border: 1px solid rgba(45,106,79,.2); }

/* Règles mot de passe sur pages publiques */
.pub-card .password-rules {
    background: rgba(139,115,85,.05);
    border: 1px solid rgba(139,115,85,.15);
    border-radius: var(--pub-radius-sm);
    padding: .9rem 1.1rem;
    margin-bottom: 1rem;
    font-size: .8rem;
    color: #5a5a72;
}
.pub-card .password-rules .rules-title {
    font-weight: 500;
    color: var(--pub-accent);
    margin-bottom: .35rem;
}
.pub-card .password-rules ul {
    padding-left: 1.1rem;
}
.pub-card .password-rules li { margin-bottom: .15rem; }

/* Texte informatif sur pages d'erreur/info */
.pub-info-text {
    font-size: .88rem;
    color: #5a5a72;
    margin-bottom: .75rem;
    line-height: 1.6;
}
.pub-info-text--muted {
    font-size: .82rem;
    color: #9090a8;
    margin-bottom: 1.75rem;
}
.pub-info-text strong { color: #1a1a2e; }

/* Message de bienvenue (setup/reset) */
.pub-greeting {
    font-size: .88rem;
    color: #5a5a72;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}
.pub-greeting strong { color: var(--pub-text); }

/* Animation */
@keyframes pubFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Responsive pages publiques */
@media (max-width: 640px) {
    .pub-card-wrapper { padding: 2rem 1.5rem; }
    .pub-card-header, .pub-card-body { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* ── PAGE LOGIN (back-office) — maintenant géré via .public-page ── */

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .main-content { padding: 1rem; }
    .navbar { padding: 0 1rem; gap: .75rem; }
    .navbar-name { display: none; }
    .user-name span:first-child { display: none; }
    .page-header { flex-direction: column; }
    .form-row { grid-template-columns: 1fr; }
    .apps-grid { grid-template-columns: 1fr; }
    .th-actions, .td-actions { min-width: auto; }
}

/* ── Avatar / Photo de profil (v1.1) ─────────────────────────── */
.avatar {
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.avatar-sm  { width: 30px;  height: 30px;  font-size: .75rem; }
.avatar-md  { width: 48px;  height: 48px;  font-size: 1rem; }
.avatar-xl  { width: 96px;  height: 96px;  font-size: 1.75rem; }

.avatar-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.avatar-initials {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: #4f46e5;
    color: #fff;
    font-weight: 700;
    letter-spacing: .04em;
}

/* ── Page profil ────────────────────────────────────────────── */
.profile-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    max-width: 860px;
}
.profile-photo-card { text-align: center; }
.photo-upload-form  { display: flex; flex-direction: column; align-items: center; gap: .5rem; }

/* Bouton-style label upload */
.btn-sm { padding: .35rem .85rem; font-size: .8rem; }

/* ── Avatar dans le tableau admin ───────────────────────────── */
.td-avatar { display: flex; align-items: center; gap: .6rem; }

/* Responsive profil */
@media (max-width: 640px) {
    .profile-layout { grid-template-columns: 1fr; }
}
