/* ═══════════════════════════════════════════════════════════════════════════
   Intranet BZE — UNSA Police
   Charte : navy #0D2047, blanc, bleu clair #378add
   Police : Calibri / Segoe UI / system fallback
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --navy:        #0D2047;
    --navy-2:      #1a3366;
    --navy-3:      #243f6c;
    --light-blue:  #378add;
    --light-blue-2:#2a6eb8;
    --bg:          #f0f2f6;
    --bg-alt:      #e8ecf5;
    --border:      #d8dde8;
    --text:        #111;
    --text-muted:  #666;
    --text-light:  #8c96a8;
    --green:       #7ab340;
    --green-bg:    #eaf3de;
    --orange:      #ba7517;
    --orange-bg:   #fff8ec;
    --red:         #e24b4a;
    --red-bg:      #fcebeb;
    --shadow-sm:   0 1px 3px rgba(13,32,71,0.08);
    --shadow-md:   0 4px 14px rgba(13,32,71,0.10);
    --shadow-lg:   0 8px 28px rgba(13,32,71,0.18);
    --radius:      12px;
    --radius-sm:   8px;
    --font:        "Calibri", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ─── Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT PUBLIC IMMERSIF (login / invitation)
   ═══════════════════════════════════════════════════════════════════════════ */

.immersive-body {
    min-height: 100vh;
    background: #050b1f;
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 0%, #1a3366 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 100%, #0d2047 0%, transparent 50%),
        linear-gradient(180deg, #050b1f 0%, #081430 50%, #050b1f 100%);
    color: white;
    font-family: var(--font);
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Logo géant en watermark en arrière-plan */
.bg-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1100px;
    height: 1100px;
    max-width: 90vmin;
    max-height: 90vmin;
    opacity: 0.045;
    pointer-events: none;
    z-index: 0;
    animation: watermark-rotate 120s linear infinite;
}

.bg-watermark img {
    width: 100%;
    height: 100%;
    filter: brightness(2) contrast(0.8);
}

@keyframes watermark-rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Halos lumineux décoratifs */
.bg-halo {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.bg-halo-1 {
    top: -200px;
    left: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(55, 138, 221, 0.25), transparent 70%);
    animation: halo-float-1 14s ease-in-out infinite;
}

.bg-halo-2 {
    bottom: -300px;
    right: -200px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(26, 51, 102, 0.4), transparent 70%);
    animation: halo-float-2 18s ease-in-out infinite;
}

@keyframes halo-float-1 {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(40px, 60px); }
}

@keyframes halo-float-2 {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(-50px, -40px); }
}

/* Wrapper principal */
.immersive-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    max-width: 520px;
    margin: 0 auto;
}

/* Header (logo + titre + accroche) */
.immersive-header {
    text-align: center;
    margin-bottom: 32px;
    animation: fade-in-up 0.6s ease-out;
}

.immersive-logo {
    width: 130px;
    height: 130px;
    margin: 0 auto 18px;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
    animation: logo-glow 4s ease-in-out infinite;
}

@keyframes logo-glow {
    0%, 100% { filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5)); }
    50%      { filter: drop-shadow(0 8px 32px rgba(55, 138, 221, 0.4)); }
}

.immersive-title {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.immersive-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 14px;
    font-weight: 600;
}

.immersive-tagline {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
    line-height: 1.5;
    max-width: 380px;
    margin: 0 auto;
}

/* Carte de login glassmorphism */
.auth-card-immersive {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 32px 28px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: fade-in-up 0.7s 0.1s ease-out backwards;
}

.auth-card-title {
    font-size: 22px;
    font-weight: 600;
    color: white;
    text-align: center;
    margin-bottom: 6px;
}

.auth-card-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    margin-bottom: 24px;
}

/* Bouton passkey premium */
.btn-passkey-immersive {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #2a6eb8 0%, #378add 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.25s ease;
    box-shadow:
        0 4px 14px rgba(55, 138, 221, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-passkey-immersive:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #378add 0%, #4f9ce8 100%);
    box-shadow:
        0 8px 24px rgba(55, 138, 221, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-passkey-immersive:active {
    transform: translateY(0);
}

.btn-passkey-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-passkey-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.btn-passkey-label {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.btn-passkey-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
}

.btn-passkey-arrow {
    font-size: 22px;
    opacity: 0.6;
    transition: transform 0.25s, opacity 0.25s;
}

.btn-passkey-immersive:hover .btn-passkey-arrow {
    opacity: 1;
    transform: translateX(4px);
}

.passkey-status {
    text-align: center;
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    min-height: 18px;
    margin-top: 10px;
}

/* Séparateur */
.divider-immersive {
    display: flex;
    align-items: center;
    margin: 26px 0 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
}

.divider-immersive::before, .divider-immersive::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider-immersive span {
    padding: 0 14px;
}

/* Formulaire immersif */
.auth-form-immersive {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field-immersive label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.field-immersive input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: white;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.field-immersive input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.field-immersive input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(55, 138, 221, 0.6);
    box-shadow: 0 0 0 3px rgba(55, 138, 221, 0.15);
}

.btn-secondary-immersive {
    margin-top: 6px;
    width: 100%;
    padding: 13px 18px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-secondary-immersive:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Footer */
.immersive-footer {
    margin-top: 32px;
    text-align: center;
    width: 100%;
    animation: fade-in-up 0.8s 0.2s ease-out backwards;
}

.footer-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin-bottom: 12px;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4f9ce8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #6db5ff;
    text-decoration: underline;
}

.footer-legal {
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    letter-spacing: 0.04em;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Override des alertes pour le mode immersif */
.auth-card-immersive .alert {
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.auth-card-immersive .alert-error,
.auth-card-immersive .alert-blocked {
    background: rgba(226, 75, 74, 0.15);
    border-color: rgba(226, 75, 74, 0.4);
    color: #ffb3b3;
}

.auth-card-immersive .alert-ok {
    background: rgba(122, 179, 64, 0.15);
    border-color: rgba(122, 179, 64, 0.4);
    color: #c5e8a0;
}

.auth-card-immersive .alert-info {
    background: rgba(55, 138, 221, 0.15);
    border-color: rgba(55, 138, 221, 0.4);
    color: #b8d8f0;
}

/* Responsive */
@media (max-width: 540px) {
    .immersive-wrapper {
        padding: 28px 16px;
    }
    .immersive-logo {
        width: 100px;
        height: 100px;
    }
    .immersive-title {
        font-size: 26px;
    }
    .immersive-tagline {
        font-size: 13px;
    }
    .auth-card-immersive {
        padding: 24px 20px;
    }
    .bg-watermark {
        opacity: 0.03;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT APP (authentifié)
   ═══════════════════════════════════════════════════════════════════════════ */

.app-body { padding-bottom: 40px; }

.app-header {
    background: var(--navy);
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand-logo { width: 42px; height: 42px; }

.brand-text .sub {
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1px;
}

.brand-text .title {
    font-size: 16px;
    font-weight: 600;
}

.app-nav {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: rgba(255,255,255,0.82);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
    text-decoration: none;
}

.app-user { display: flex; align-items: center; gap: 10px; }

.user-info { text-align: right; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.65); }

.btn-icon {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.2);
    text-decoration: none;
}

.app-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 600;
    color: var(--navy);
    margin: 0;
}

.page-header p { margin: 4px 0 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   HERO ACCUEIL DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */

.hero-welcome {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 50%, var(--navy-3) 100%);
    border-radius: 18px;
    padding: 28px 32px;
    margin-bottom: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Effet décoratif radial dans le coin supérieur droit */
.hero-welcome::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(55, 138, 221, 0.25), transparent 60%);
    pointer-events: none;
}

.hero-greeting {
    position: relative;
    z-index: 1;
    margin-bottom: 22px;
}

.hero-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 8px;
}

.hero-title {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.hero-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}

/* Cartes stat dans le hero */
.hero-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.hero-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all 0.2s ease;
}

.hero-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.hero-card-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-card-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.hero-card-content { flex: 1; min-width: 0; }

.hero-card-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin: 0 0 4px;
}

.hero-card-value {
    font-size: 14px;
    color: white;
    font-weight: 600;
    margin: 0 0 2px;
    line-height: 1.3;
}

.hero-card-value-big {
    font-size: 32px;
    color: white;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.hero-card-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 4px 0 0;
}

.hero-card-meta a {
    color: #6db5ff;
    text-decoration: none;
}

.hero-card-meta a:hover { text-decoration: underline; }

@media (max-width: 700px) {
    .hero-welcome { padding: 22px 20px; }
    .hero-title { font-size: 22px; }
    .hero-cards { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CALENDRIER + UPCOMING ROW
   ═══════════════════════════════════════════════════════════════════════════ */

.calendar-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .calendar-row { grid-template-columns: 1fr; }
}

/* Carte calendrier */
.calendar-card,
.upcoming-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.calendar-header h2 {
    font-size: 18px;
    color: var(--navy);
    margin: 0;
    font-weight: 600;
    text-transform: capitalize;
}

.calendar-legend {
    display: flex;
    gap: 14px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-formation { background: var(--light-blue); }
.dot-a13       { background: #9b51e0; } /* violet pour Article 13 */
.dot-vacances  { background: var(--orange); }

/* Grille du mois */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-weekday {
    font-size: 11px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
    padding: 6px 0;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1 / 1;
    background: var(--bg);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: default;
    transition: all 0.15s;
}

.calendar-day-empty {
    background: transparent;
}

.calendar-day-num {
    line-height: 1;
}

.calendar-day:hover:not(.calendar-day-empty) {
    background: var(--bg-alt);
    transform: scale(1.05);
}

.calendar-day-today {
    background: var(--navy);
    color: white;
    font-weight: 700;
}

.calendar-day-today:hover {
    background: var(--navy-2) !important;
}

.calendar-day-formation {
    background: rgba(55, 138, 221, 0.12);
    color: var(--navy);
    border: 1px solid rgba(55, 138, 221, 0.4);
}

.calendar-day-a13 {
    background: rgba(155, 81, 224, 0.10);
    color: #5b2db8;
    border: 1px solid rgba(155, 81, 224, 0.35);
}

.calendar-day-formation.calendar-day-a13 {
    background: linear-gradient(135deg, rgba(55, 138, 221, 0.18) 50%, rgba(155, 81, 224, 0.18) 50%);
}

.calendar-day-vacances {
    background: rgba(186, 117, 23, 0.10);
    color: #633806;
}

.calendar-day-formation.calendar-day-vacances {
    background: linear-gradient(135deg, rgba(55, 138, 221, 0.2) 50%, rgba(186, 117, 23, 0.2) 50%);
}

.calendar-day-formation.calendar-day-today,
.calendar-day-vacances.calendar-day-today {
    background: var(--navy);
    color: white;
    border: none;
}

.calendar-day-dots {
    display: flex;
    gap: 2px;
    margin-top: 2px;
}

.calendar-day-dots .dot {
    width: 5px;
    height: 5px;
}

/* Carte upcoming (prochaines formations) */
.upcoming-card h2 {
    font-size: 18px;
    color: var(--navy);
    margin: 0 0 14px;
    font-weight: 600;
}

.upcoming-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.upcoming-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f2f6;
}

.upcoming-item:last-child {
    border-bottom: none;
}

.upcoming-date {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: var(--bg-alt);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--navy);
    line-height: 1;
}

.upcoming-day {
    font-size: 18px;
    font-weight: 700;
}

.upcoming-month {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.upcoming-content {
    flex: 1;
    min-width: 0;
}

.upcoming-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    margin: 0;
}

.upcoming-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin: 2px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upcoming-status {
    flex-shrink: 0;
}

.badge-open    { background: #639922; color: white; }
.badge-closed  { background: #888; color: white; }

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION TUILES PRO
   ═══════════════════════════════════════════════════════════════════════════ */

.tiles-section { margin-top: 8px; }

.tiles-section-title {
    font-size: 16px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 14px;
    padding-left: 4px;
}

.tiles-grid-pro {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.tile-pro {
    position: relative;
    border-radius: 14px;
    padding: 20px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tile-pro::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.tile-pro:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 32px rgba(13, 32, 71, 0.25);
    text-decoration: none;
}

.tile-pro:hover::before { opacity: 1; }

.tile-pro-navy {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
    color: white;
}

.tile-pro-blue {
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--light-blue-2) 100%);
    color: white;
}

.tile-pro-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
}

.tile-pro:hover .tile-pro-icon {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.05) rotate(-3deg);
}

.tile-pro-icon svg {
    width: 26px;
    height: 26px;
    color: white;
}

.tile-pro-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
}

.tile-pro-label {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.25;
}

.tile-pro-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    margin: 3px 0 0;
    line-height: 1.3;
}

.tile-pro-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 24px;
    height: 22px;
    padding: 0 8px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.tile-pro-external {
    position: absolute;
    bottom: 12px;
    right: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    transition: all 0.2s;
}

.tile-pro:hover .tile-pro-external {
    color: white;
    transform: translate(2px, -2px);
}

@media (max-width: 480px) {
    .tiles-grid-pro {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .tile-pro {
        padding: 14px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .tile-pro-label { font-size: 13px; }
    .tile-pro-desc { font-size: 11px; }
    .tile-pro-icon { width: 38px; height: 38px; }
    .tile-pro-icon svg { width: 20px; height: 20px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODULE DÉLÉGUÉS — annuaire
   ═══════════════════════════════════════════════════════════════════════════ */

/* Barre de recherche */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-wrap {
    flex: 1;
    min-width: 220px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap svg {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-wrap input {
    width: 100%;
    padding: 11px 14px 11px 42px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.search-input-wrap input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(13, 32, 71, 0.1);
}

.search-bar select {
    min-width: 200px;
    padding: 11px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}

/* ─── Section département v2 (style liste compact) ─────────────────────── */
.dept-section-v2 {
    margin-bottom: 24px;
}

.dept-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px 10px;
    border-bottom: 2px solid var(--bg-alt);
    margin-bottom: 8px;
}

.dept-code-chip {
    background: var(--navy);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 5px;
    letter-spacing: 0.05em;
}

.dept-section-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
}

.dept-section-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-alt);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* Liste compacte */
.delegues-list {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.delegue-row {
    display: grid;
    grid-template-columns: 42px 1.4fr 1.6fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid #f0f2f6;
    transition: background 0.12s;
}

.delegue-row:last-child { border-bottom: none; }

.delegue-row:hover {
    background: #fafbfc;
    text-decoration: none;
}

.delegue-row-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    color: white;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.delegue-row-main {
    min-width: 0;
    overflow: hidden;
}

.delegue-row-name {
    font-size: 14px;
    color: var(--navy);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delegue-row-name strong { font-weight: 700; }

.delegue-row-name .chip {
    margin-left: 4px;
    font-size: 9px;
    padding: 1px 6px;
    background: var(--bg-alt);
    color: var(--navy);
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    vertical-align: 1px;
}

.delegue-row-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delegue-row-meta span { margin-right: 2px; }

.delegue-row-contact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    color: var(--text-muted);
    min-width: 0;
}

.delegue-row-email,
.delegue-row-tel {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delegue-row-status {
    flex-shrink: 0;
}

.delegue-row-arrow {
    color: var(--text-light);
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
}

/* Status pills (mode liste) */
.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 11px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border: 1px solid;
}

.status-pill-green  { background: var(--green-bg);  color: #27500a; border-color: var(--green); }
.status-pill-orange { background: var(--orange-bg); color: #633806; border-color: var(--orange); }
.status-pill-gray   { background: var(--bg-alt);    color: var(--text-light); border-color: var(--border); }

/* Anciennes classes status (compat avec status-badge des autres pages) */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 11px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.status-green  { background: var(--green-bg);  color: #27500a; }
.status-orange { background: var(--orange-bg); color: #633806; }
.status-gray   { background: var(--bg-alt);    color: var(--text-muted); }

/* Responsive : sur mobile, simplifier la liste */
@media (max-width: 768px) {
    .delegue-row {
        grid-template-columns: 42px 1fr auto;
        gap: 10px;
    }
    .delegue-row-contact { display: none; }
    .delegue-row-arrow { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FICHE DÉLÉGUÉ — page show
   ═══════════════════════════════════════════════════════════════════════════ */

.status-banner {
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.status-banner-green  { background: linear-gradient(135deg, #639922, #7ab340); color: white; }
.status-banner-orange { background: linear-gradient(135deg, #ba7517, #d28f25); color: white; }
.status-banner-gray   { background: linear-gradient(135deg, #56657d, #6b7c97); color: white; }

.status-banner-info { flex: 1; min-width: 200px; }

.status-banner-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin: 0 0 6px;
    font-weight: 600;
}

.status-banner-value {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
}

.status-banner-time {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
}

.status-banner-note {
    font-size: 13px;
    margin: 8px 0 0;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-block;
}

.status-banner-actions {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 12px 14px;
}

.quick-status-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-quick-status {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-quick-status:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MATRICE PERMISSIONS (admin)
   ═══════════════════════════════════════════════════════════════════════════ */

.permissions-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-top: 12px;
}

.permissions-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    background: white;
}

.permissions-table th,
.permissions-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f2f6;
    vertical-align: middle;
    text-align: left;
}

.permissions-table thead th {
    background: var(--bg);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 2px solid var(--border);
}

.permissions-table .sticky-col {
    position: sticky;
    left: 0;
    background: white;
    z-index: 4;
    min-width: 220px;
    border-right: 2px solid var(--border);
}

.permissions-table thead th.sticky-col {
    background: var(--bg);
    z-index: 6;
}

.permissions-table tbody tr:hover td {
    background: #fafbfc;
}

.permissions-table tbody tr:hover .sticky-col {
    background: #fafbfc;
}

.permissions-table .perm-col {
    text-align: center;
    min-width: 130px;
}

.user-cell {
    line-height: 1.3;
}

.user-cell strong {
    margin-right: 4px;
}

/* Sélecteurs colorés */
.perm-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    transition: all 0.15s;
}

.perm-select.perm-none  { background: var(--bg-alt);    color: var(--text-muted); border-color: var(--border); }
.perm-select.perm-read  { background: #e6f1fb;          color: #042c53;           border-color: #378add; }
.perm-select.perm-write { background: #eaf3de;          color: #27500a;           border-color: var(--green); }

/* Pills de légende */
.perm-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid;
}

.perm-pill.perm-none  { background: var(--bg-alt); color: var(--text-muted); border-color: var(--border); }
.perm-pill.perm-read  { background: #e6f1fb;       color: #042c53;           border-color: #378add; }
.perm-pill.perm-write { background: #eaf3de;       color: #27500a;           border-color: var(--green); }

/* ─── Carte calage automatique du cycle ────────────────────────────────── */
.autocale-card {
    background: linear-gradient(135deg, #f7faff, #eef4ff);
    border-left: 4px solid var(--light-blue);
}

.autocale-card h2 {
    color: var(--navy);
    margin-bottom: 6px;
}

.autocale-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.autocale-buttons button {
    flex: 1;
    min-width: 200px;
    padding: 14px 20px;
    font-size: 15px;
}

/* ─── Éditeur de cycle binaire ──────────────────────────────────────────── */
.cycle-editor {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin: 12px 0;
}

.cycle-editor-help {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 12px;
    line-height: 1.5;
}

.cycle-editor-bze-info {
    background: white;
    border: 1px solid var(--light-blue);
    border-left: 4px solid var(--light-blue);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.cycle-editor-bze-info strong {
    color: var(--navy);
    display: block;
    margin-bottom: 6px;
}

.cycle-editor-bze-info p {
    margin: 0 0 8px;
    color: var(--text);
}

.cycle-editor-bze-info ul {
    margin: 6px 0 8px 18px;
    padding: 0;
    color: var(--text);
}

.cycle-editor-bze-info li {
    margin-bottom: 4px;
}

.cycle-editor-bze-info em {
    color: var(--text-muted);
    font-style: italic;
}

.cycle-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.cycle-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 8px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.cycle-day input { display: none; }

.cycle-day span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.cycle-day:hover {
    border-color: var(--navy);
    transform: translateY(-1px);
}

.cycle-day.checked {
    background: var(--light-blue);
    border-color: var(--light-blue-2);
}

.cycle-day.checked span {
    color: white;
}

/* ─── Vue jour du calendrier ────────────────────────────────────────────── */
.day-nav {
    display: flex;
    gap: 8px;
}

.calendar-day-link {
    text-decoration: none;
    cursor: pointer;
}

.calendar-day-link:hover:not(.calendar-day-empty) {
    background: var(--bg-alt);
    transform: scale(1.08);
    text-decoration: none;
}

.day-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.day-list-item {
    border-bottom: 1px solid #f0f2f6;
}

.day-list-item:last-child {
    border-bottom: none;
}

.day-list-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    text-decoration: none;
    color: var(--text);
    transition: background 0.12s;
}

.day-list-link:hover {
    text-decoration: none;
    background: #fafbfc;
}

.day-list-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--green), #5a9018);
    color: white;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.day-list-avatar-off {
    background: linear-gradient(135deg, var(--text-light), #6b7c97);
}

.day-list-main {
    flex: 1;
    min-width: 0;
    font-size: 14px;
}

.day-list-link-off { opacity: 0.7; }

/* Liste de définitions pour les coordonnées */
.info-list {
    margin: 0;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 14px;
}

.info-list dt {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    padding-top: 2px;
}

.info-list dd {
    margin: 0;
    font-size: 14px;
    color: var(--text);
}

.info-list dd a { color: var(--navy); }

/* ═══════════════════════════════════════════════════════════════════════════
   Anciennes tuiles (legacy) ─────────────────────────────────────────────── */
/* ─── Anciennes tuiles (legacy, gardées pour compat) ────────────────────── */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.tile {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    transition: transform 0.18s, box-shadow 0.18s;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile-navy { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: white; }
.tile-blue { background: linear-gradient(135deg, var(--light-blue) 0%, var(--light-blue-2) 100%); color: white; }
.tile-icon { width: 44px; height: 44px; opacity: 0.9; }
.tile-icon svg { width: 100%; height: 100%; }
.tile-label { font-size: 16px; font-weight: 600; color: white; line-height: 1.25; }
.tile-badge {
    position: absolute; top: 14px; right: 14px;
    background: rgba(255,255,255,0.25); color: white;
    font-size: 12px; font-weight: 700;
    min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.card h2 {
    font-size: 18px;
    color: var(--navy);
    margin-bottom: 12px;
    font-weight: 600;
}

.card h3 {
    font-size: 14px;
    color: var(--navy);
    margin-bottom: 8px;
    font-weight: 600;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-header h2 { margin: 0; }

.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.grid-two > .card { margin-bottom: 0; }

@media (max-width: 760px) {
    .grid-two { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH CARDS (login, invitation, profile)
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-card {
    padding: 28px 24px;
    box-shadow: var(--shadow-lg);
    border: none;
}

.auth-card-wide { max-width: 560px; margin: 0 auto; }

.auth-heading {
    text-align: center;
    font-size: 22px;
    color: var(--navy);
    margin-bottom: 18px;
    font-weight: 600;
}

.auth-form { display: flex; flex-direction: column; gap: 4px; }

.btn-passkey {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 4px;
}

.divider {
    display: flex;
    align-items: center;
    margin: 22px 0 18px;
    color: var(--text-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider span { padding: 0 12px; }

.invitation-info {
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin: 16px 0 20px;
}

.invitation-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.invitation-info .info-label {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
}

.invitation-info .info-value {
    color: var(--navy);
    font-weight: 600;
}

.step-title {
    border-bottom: 2px solid var(--navy);
    padding-bottom: 4px;
    margin: 18px 0 12px !important;
    font-size: 15px !important;
}

.totp-setup {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin: 12px 0;
}

.totp-qr {
    width: 180px;
    height: 180px;
    background: white;
    padding: 8px;
    border-radius: 8px;
}

.totp-secret {
    display: block;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: ui-monospace, "SF Mono", Monaco, monospace;
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--navy);
    word-break: break-all;
    user-select: all;
    border: 1px solid var(--border);
}

.totp-input {
    font-size: 22px !important;
    letter-spacing: 0.35em !important;
    text-align: center;
    font-family: ui-monospace, monospace;
}

@media (max-width: 600px) {
    .totp-setup { grid-template-columns: 1fr; text-align: center; }
    .totp-qr { margin: 0 auto; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */

.form-group { margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=tel], input[type=number], select, textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text);
    outline: none;
    transition: border 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(13,32,71,0.12);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
    color: var(--text);
    font-weight: normal;
    cursor: pointer;
}

.checkbox-label input { width: auto; }

@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════════════════════════
   BOUTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
}

.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--navy);
    color: white;
    border-color: var(--navy);
}

.btn-primary:hover { background: var(--navy-2); }

.btn-secondary {
    background: white;
    color: var(--navy);
    border-color: var(--border);
}

.btn-secondary:hover { background: var(--bg); border-color: var(--navy); }

.btn-danger {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

.btn-danger:hover { background: #c73d3c; }

.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    width: 100%;
    margin-top: 8px;
}

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTES
   ═══════════════════════════════════════════════════════════════════════════ */

.alert {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 14px;
    border: 1px solid;
}

.alert-ok, .alert-success {
    background: var(--green-bg);
    color: #27500a;
    border-color: var(--green);
}

.alert-error, .alert-blocked {
    background: var(--red-bg);
    color: #791f1f;
    border-color: var(--red);
}

.alert-info {
    background: #e6f1fb;
    color: #042c53;
    border-color: #378add;
}

.alert-urgent {
    background: var(--orange-bg);
    color: #633806;
    border-color: var(--orange);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES & CHIPS
   ═══════════════════════════════════════════════════════════════════════════ */

.badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-admin          { background: var(--navy);       color: white; }
.badge-delegue_dept   { background: var(--light-blue); color: white; }
.badge-delegue        { background: var(--bg-alt);     color: var(--navy); }

.chip {
    display: inline-block;
    background: var(--bg-alt);
    color: var(--navy);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABLEAUX
   ═══════════════════════════════════════════════════════════════════════════ */

.table-container {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 12px;
}

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

th {
    background: var(--bg);
    font-weight: 600;
    font-size: 11px;
    color: var(--text-muted);
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td {
    padding: 11px 14px;
    border-bottom: 1px solid #f0f2f6;
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: #fafbfc; }

/* ═══════════════════════════════════════════════════════════════════════════
   PASSKEY LIST
   ═══════════════════════════════════════════════════════════════════════════ */

.passkey-list {
    list-style: none;
    margin-top: 12px;
}

.passkey-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.passkey-item:last-child { margin-bottom: 0; }

.passkey-item p { margin: 2px 0 0; font-size: 12px; }

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 24px 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   INVITATION LINK CARD
   ═══════════════════════════════════════════════════════════════════════════ */

.invitation-link-card { background: var(--bg-alt); border-color: var(--navy); }

.link-box {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: ui-monospace, monospace;
    font-size: 12px;
    word-break: break-all;
    color: var(--navy);
    margin: 10px 0;
    user-select: all;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILS
   ═══════════════════════════════════════════════════════════════════════════ */

.text-muted   { color: var(--text-muted); font-size: 13px; }
.text-center  { text-align: center; }
.text-danger  { color: var(--red); }
.text-success { color: #27500a; }
.hidden       { display: none !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* Responsive header */
@media (max-width: 820px) {
    .app-header {
        flex-wrap: wrap;
        padding: 10px 14px;
    }
    .app-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-top: 8px;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 6px;
    }
    .user-info { display: none; }
    .tiles-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .brand-text .title { font-size: 14px; }
    .brand-text .sub { display: none; }
}

@media (max-width: 480px) {
    .tiles-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .tile { padding: 14px; }
    .tile-label { font-size: 13px; }
    .page-header h1 { font-size: 22px; }
}
