/* ── VARIABLES ─────────────────────────────────────────────── */

:root {
    --primary:         #1e3a5f;
    --primary-light:   #2c5282;
    --secondary:       #35c8de;
    --bg-surface:      #ffffff;
    --bg-overlay:      rgba(255, 255, 255, 0.95);
    --text-primary:    #1a202c;
    --text-muted:      #718096;
    --border-color:    #e2e8f0;
    --border-focus:    #35c8de;
    --shadow-xl:       0 25px 60px rgba(0, 0, 0, 0.15);
    --radius-md:       10px;
    --radius-lg:       16px;
    --radius-xl:       24px;
    --transition-base: 0.2s ease;
    --transition-slow: 0.5s ease;
    --font-display:    'Sora', sans-serif;
    --font-body:       'DM Sans', sans-serif;
    --spacing-xs:      0.375rem;
    --spacing-sm:      0.625rem;
    --spacing-md:      1rem;
    --spacing-lg:      1.5rem;
    --spacing-xl:      2rem;
    --spacing-2xl:     3rem;
}

/* BASE */

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #dde8f4 0%, #f0f4f8 50%, #e8f4f8 100%);
    min-height: 100vh;
}

/* LOGIN PAGE */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

.login-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1000px;
    width: 100%;
    background: var(--bg-overlay);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
    animation: slideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Left brand panel */

.login-brand {
    background: linear-gradient(135deg, #1a3354 100%);
    padding: var(--spacing-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -40%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(53, 200, 222, 0.12) 0%, transparent 65%);
    animation: rotateBg 22s linear infinite;
}

@keyframes rotateBg {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    animation: fadeUp 0.8s ease-out 0.2s both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.brand-logo-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-xl);
    backdrop-filter: blur(8px);
    font-size: 4rem;
}

.brand-title {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-sm);
}

.brand-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
    margin-bottom: var(--spacing-2xl);
}

.security-badges {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xl);
}

.badge-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.6rem var(--spacing-md);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 0.82rem;
    transition: all var(--transition-base);
}

.badge-item:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateX(4px);
}

/* Right form panel */

.login-form-panel {
    padding: var(--spacing-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.form-content {
    width: 100%;
    max-width: 380px;
    animation: fadeUp 0.8s ease-out 0.35s both;
}

.form-title {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.02em;
}

.form-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xl);
}

/* Alert */

.alert-custom {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-size: 0.875rem;
    border: 1px solid;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-custom.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* Form */

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-base);
    display: flex;
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 3rem;
    font-size: 0.9375rem;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: #f7fafc;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--border-focus);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(53, 200, 222, 0.1);
}

.input-wrapper:focus-within .input-icon {
    color: var(--secondary);
}

/* Submit button */

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem var(--spacing-xl);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-display);
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 14px rgba(30, 58, 95, 0.3);
    position: relative;
    overflow: hidden;
    margin-top: var(--spacing-sm);
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left var(--transition-slow);
}

.btn-submit:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.4);
}

.btn-submit:hover::before {
    left: 100%;
}

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

/* Footer */

.form-footer {
    margin-top: var(--spacing-lg);
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

body.authenticated {
    background: #f7fafc;
}

/* Navbar */
.navbar-app {
    background: var(--primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    min-height: 70px;
    margin-bottom: 1.5rem;
}

.navbar-panda img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-primary-950);
    overflow: hidden;
    flex-shrink: 0;
}

.navbar-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--bg-surface) !important;
    text-decoration: none;
    letter-spacing: -.01em;
}

.navbar-brand strong {
    color: var(--secondary);
}

.navbar-app .nav-link {
    color: var(--bg-surface) !important;
    font-size: .9rem;
    font-weight: 500;
    padding: .5rem .9rem !important;
    border-radius: 8px;
    transition: all var(--transition-base);
}

.navbar-app .nav-link:hover {
    background: var(--secondary);
    color: var(--bg-surface) !important;
}

/* Bouton déconnexion */
.btn-deconnexion {
    border: 1px solid var(--primary) !important;
    background: transparent;
    color: #fff;
    border-radius: 8px;
    border-color: var(--secondary) !important;
    font-size: .85rem;
    font-weight: 600;
}

.btn-deconnexion:hover {
    background: transparent;
    color: #fff;
}

/* Contenu */
.dashboard-header {
    margin-bottom: 2rem;
}

.welcome-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
    margin-top: 0.3rem;
}

/* Indicateur live */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #16a34a;
    margin-top: 0.5rem;
    font-weight: 500;
}

.live-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%   { transform: scale(1);   opacity: 1; }
    50%  { transform: scale(1.4); opacity: 0.5; }
    100% { transform: scale(1);   opacity: 1; }
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.card-intranet {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    transition: transform .15s ease, box-shadow .15s ease;
}

.card-intranet:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.card-intranet h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.card-intranet p {
    font-size: 0.85rem;
    color: #6b7280;
}

/* RESPONSIVE */

@media (max-width: 768px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        max-width: 480px;
    }

    .login-brand {
        padding: var(--spacing-xl);
    }

    .brand-logo-circle {
        width: 110px;
        height: 110px;
        font-size: 3rem;
    }

    .brand-title {
        font-size: 1.4rem;
    }

    .security-badges {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: var(--spacing-md);
    }

    .login-form-panel {
        padding: var(--spacing-lg);
    }

    .form-title {
        font-size: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* ═══════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════ */

/* Wrapper principal */
.dash-wrapper {
    padding: 1.5rem 2rem;
    max-width: 1400px;
}

/* En-tête de bienvenue */
.dash-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.dash-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.dash-subtitle {
    font-size: .875rem;
    color: var(--text-primary);
    margin-top: .2rem;
}

.dash-meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.badge-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    color: #16a34a;
    font-weight: 600;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: .25rem .75rem;
}

.date-badge {
    font-size: .8rem;
    color: var(--bg-surface);
    background: var(--secondary);
    border-radius: 8px;
    padding: .35rem .8rem;
    border: 1px solid var(--border-color);
}

/* ── Statistiques — 2 cards centrées ──────────────── */
.dash-stats {
    display: flex;
    justify-content:flex-start;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.75rem 2.25rem;
    width: 320px;
    min-width: 240px;
    transition: transform .15s ease, box-shadow .15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30, 58, 95, 0.09);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .85rem;
}

.stat-label {
    font-size: .72rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.stat-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
    margin: .2rem 0 .25rem;
}

.stat-trend {
    font-size: .78rem;
    font-weight: 500;
}

.trend-up   { color: #16a34a; }
.trend-down { color: #dc2626; }

/* ── Widgets ───────────────────────────────────────── */
.dash-widget {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem;
    
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: .07em;
}

.widget-link {
    font-size: .75rem;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
}

.widget-link:hover {
    text-decoration: underline;
}

.widget-sub {
    font-size: .72rem;
    color: var(--text-primary);
}

.date-badge-sm {
    font-size: .72rem;
    color: var(--bg-surface);
    background: var(--secondary);
    border-radius: 6px;
    padding: .2rem .6rem;
    border: 1px solid var(--border-color);
}

.badge-count {
    font-size: .72rem;
    font-weight: 700;
    padding: .2rem .65rem;
    border-radius: 20px;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* ── Grilles ───────────────────────────────────────── */
.dash-grid-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dash-widget--full {
    grid-column: 1 / -1;
}

.dash-grid-bottom {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
}

/* ── Événements — cards avec badges ───────────────── */
.event-cards {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.event-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: .85rem 1rem;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.event-card:hover {
    box-shadow: 0 3px 12px rgba(30, 58, 95, 0.09);
    border-color: #cbd5e1;
}

.event-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .35rem;
}

.event-card-date {
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.event-card-title {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: .3rem;
}

.event-card-meta {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.event-card-meta svg {
    opacity: 0.55;
    flex-shrink: 0;
}

/* Badges catégorie événement */
.event-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: .2em .65em;
    border-radius: 999px;
    text-transform: uppercase;
}

.event-badge--reunion   { background: rgba(53, 200, 222, 0.15); color: #0e7490; }
.event-badge--formation { background: rgba(124, 58, 237, 0.12); color: #6d28d9; }
.event-badge--direction { background: rgba(30, 58, 95, 0.10);   color: #1e3a5f; }
.event-badge--atelier   { background: rgba(16, 185, 129, 0.12); color: #065f46; }

/* ── Agenda ────────────────────────────────────────── */
.agenda-list {
    list-style: none;
    padding: 0;
}

.agenda-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.agenda-time {
    font-size: .72rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 50px;
    text-align: center;
    background: var(--secondary);
    border-radius: 6px;
    padding: .3rem .4rem;
    line-height: 1.3;
    flex-shrink: 0;
}

.agenda-title {
    font-size: .825rem;
    font-weight: 600;
    color: var(--text-primary);
}

.agenda-sub {
    font-size: .72rem;
    color: #9ca3af;
    margin-top: .1rem;
}

/* ── Accès rapides ─────────────────────────────────── */
.quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .8rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: .82rem;
    color: #374151;
    text-decoration: none;
    transition: all .15s ease;
}

.quick-link svg { color: var(--primary); flex-shrink: 0; }

.quick-link:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

/* ── Annonces internes ─────────────────────────────── */
.annonce-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.annonce-item {
    padding: .85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    transition: box-shadow .15s ease;
}

.annonce-item:hover {
    box-shadow: 0 2px 10px rgba(30, 58, 95, 0.07);
}

.annonce-unread {
    border-left: 3px solid var(--secondary);
    background: #f0fdff;
}

.annonce-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .35rem;
}

.annonce-author {
    font-size: .72rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.annonce-date {
    font-size: .7rem;
    color: var(--text-muted);
}

.annonce-text {
    font-size: .825rem;
    color: #374151;
    line-height: 1.5;
    margin: 0;
}

/* ── Tickets ───────────────────────────────────────── */
.ticket-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.prio {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.prio-high { background: #ef4444; }
.prio-mid  { background: #f59e0b; }
.prio-low  { background: #22c55e; }

.ticket-label {
    font-size: .825rem;
    color: #374151;
    flex: 1;
}

.ticket-badge {
    font-size: .68rem;
    padding: .2rem .55rem;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-open     { background: #eff6ff; color: #1d4ed8; }
.badge-progress { background: #fff7ed; color: #c2410c; }
.badge-done     { background: #f0fdf4; color: #15803d; }

/* ── Activité ──────────────────────────────────────── */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .55rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.av {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 700;
    flex-shrink: 0;
}

.activity-text {
    font-size: .825rem;
    color: #374151;
    line-height: 1.4;
}

.activity-time {
    font-size: .7rem;
    color: #9ca3af;
    margin-top: .1rem;
}

/* ── Tags annonces/news ────────────────────────────── */
.news-item {
    padding: .55rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.news-tag {
    display: inline-block;
    font-size: .62rem;
    font-weight: 700;
    padding: .15rem .5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .25rem;
}

.tag-cyber { background: #fef2f2; color: #b91c1c; }
.tag-rh    { background: #eff6ff; color: #1d4ed8; }
.tag-it    { background: #f0fdf4; color: #15803d; }
.tag-org   { background: #faf5ff; color: #6d28d9; }

.news-title {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: .15rem;
}

.news-date {
    font-size: .7rem;
    color: #9ca3af;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1024px) {
    .dash-grid-main   { grid-template-columns: 1fr; }
    .dash-grid-bottom { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .dash-wrapper     { padding: 1rem; }
    .dash-stats       { gap: 1rem; }
    .stat-card        { width: 100%; }
    .dash-grid-bottom { grid-template-columns: 1fr; }
    .quick-links      { grid-template-columns: 1fr; }
}

/* ── Dropdown sous-onglets ─────────────────────────── */
.navbar-app .dropdown-menu {
    background: var(--secondary);
    border: 1px solid var(--primary-light);
    border-radius: 8px;
    padding: .25rem;
}

.navbar-app .navbar-nav {
    gap: .25rem;
}

.navbar-app .dropdown-item {
    font-size: .9rem;
    font-weight: 500;
    color: var(--bg-surface) !important;
    border-radius: 8px;
    padding: .5rem .9rem !important;
    transition: none;
    background: var(--secondary);
}

.navbar-app .dropdown-item:hover {
    background: var(--secondary);
     opacity: 0.8;
    /* color: var(--text-primary) !important; */
}