/* ===== THEME DE NOËL ULTRA COLORÉ & RÉALISTE ===== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Palette Hiver & Noël Vivante */
    --bg-dark: #0a0d14;
    --bg-card: rgba(16, 22, 36, 0.82);
    --border: rgba(255, 255, 255, 0.1);
    --text: #f8fafc;
    --text-muted: #94a3b8;

    /* Couleurs de fête */
    --xmas-red: #f43f5e;
    --xmas-red-glow: rgba(244, 63, 94, 0.45);
    --xmas-gold: #fbbf24;
    --xmas-gold-glow: rgba(251, 191, 36, 0.45);
    --xmas-green: #10b981;
    --xmas-green-glow: rgba(16, 185, 129, 0.45);
    --xmas-blue: #38bdf8;
    --xmas-blue-glow: rgba(56, 189, 248, 0.45);

    --radius: 14px;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    /* Fond aurores boréales magiques (Vert sapin doux à gauche, Rouge rubis chaleureux à droite) */
    background: 
        radial-gradient(circle at 10% 15%, rgba(16, 185, 129, 0.13) 0%, transparent 45%),
        radial-gradient(circle at 90% 25%, rgba(244, 63, 94, 0.16) 0%, transparent 50%),
        radial-gradient(circle at 50% 85%, rgba(56, 189, 248, 0.08) 0%, transparent 55%),
        #090d16;
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

/* ===== GUIRLANDE DE NOËL LUMINEUSE ===== */
.xmas-lightrope {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 10px;
    z-index: 9999;
    pointer-events: none;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.xmas-bulb {
    width: 11px;
    height: 15px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    margin: 0 4px;
    display: inline-block;
    position: relative;
    animation: bulbTwinkle 1.4s infinite alternate ease-in-out;
}

.xmas-bulb::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 3px;
    width: 5px;
    height: 3px;
    background: #334155;
    border-radius: 2px;
}

.xmas-bulb.red   { background: #ff2e63; box-shadow: 0 2px 14px 4px rgba(255, 46, 99, 0.85); }
.xmas-bulb.gold  { background: #ffb703; box-shadow: 0 2px 14px 4px rgba(255, 183, 3, 0.85); }
.xmas-bulb.green { background: #06d6a0; box-shadow: 0 2px 14px 4px rgba(6, 214, 160, 0.85); }
.xmas-bulb.blue  { background: #118ab2; box-shadow: 0 2px 14px 4px rgba(17, 138, 178, 0.85); }
.xmas-bulb.cyan  { background: #38bdf8; box-shadow: 0 2px 14px 4px rgba(56, 189, 248, 0.85); }

@keyframes bulbTwinkle {
    0%   { opacity: 0.35; transform: scale(0.85); }
    100% { opacity: 1;    transform: scale(1.15); }
}

/* ===== LAYOUT & SIDEBAR FESTIVE ===== */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 275px;
    background: rgba(12, 17, 29, 0.88);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 26px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 10;
}

.sidebar-header {
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 21px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #fff 40%, var(--xmas-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo::after {
    content: '🎅';
    font-size: 24px;
    -webkit-text-fill-color: initial;
    filter: drop-shadow(0 2px 8px rgba(244, 63, 94, 0.5));
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.12);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.25) 0%, rgba(251, 191, 36, 0.15) 100%);
    color: #fff;
    border: 1px solid rgba(244, 63, 94, 0.5);
    box-shadow: 0 4px 18px var(--xmas-red-glow);
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-weight: 700;
    font-size: 15px;
    color: #fff;
}

.user-grade {
    font-size: 11px;
    font-weight: 800;
    color: var(--xmas-gold);
    letter-spacing: 1px;
    text-shadow: 0 0 10px var(--xmas-gold-glow);
}

.logout-btn {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.15) 0%, rgba(244, 63, 94, 0.05) 100%);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fda4af;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--xmas-red);
    color: #fff;
    box-shadow: 0 4px 15px var(--xmas-red-glow);
}

.snow-toggle {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 7px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.snow-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--xmas-blue);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 38px 46px;
    max-width: 1400px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ffffff 40%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===== STATS CARDS COLORÉES & FESTIVES ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
}

/* Dépose de neige subtile sur le dessus des stat-cards */
.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 4px 4px 0 0;
}

/* 1ère carte : Bleu Givré */
.stats-grid .stat-card:nth-child(1)::after {
    background: linear-gradient(90deg, var(--xmas-blue), #818cf8);
    box-shadow: 0 0 14px var(--xmas-blue-glow);
}
.stats-grid .stat-card:nth-child(1) .stat-number {
    color: var(--xmas-blue);
    text-shadow: 0 0 20px var(--xmas-blue-glow);
}

/* 2ème carte : Ambre / Or de Noël */
.stats-grid .stat-card:nth-child(2)::after {
    background: linear-gradient(90deg, var(--xmas-gold), #f97316);
    box-shadow: 0 0 14px var(--xmas-gold-glow);
}
.stats-grid .stat-card:nth-child(2) .stat-number {
    color: var(--xmas-gold);
    text-shadow: 0 0 20px var(--xmas-gold-glow);
}

/* 3ème carte : Vert Émeraude Festif */
.stats-grid .stat-card:nth-child(3)::after {
    background: linear-gradient(90deg, var(--xmas-green), #34d399);
    box-shadow: 0 0 14px var(--xmas-green-glow);
}
.stats-grid .stat-card:nth-child(3) .stat-number {
    color: #34d399;
    text-shadow: 0 0 20px var(--xmas-green-glow);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 35px -6px rgba(0, 0, 0, 0.7);
}

.stat-number {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -1.5px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== CARDS & TABLES AVEC FINITIONS GIVRÉES ===== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 35px -10px rgba(0, 0, 0, 0.6);
    margin-bottom: 30px;
    position: relative;
}

/* Ligne givrée sur le haut de la carte */
.card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.card-header {
    padding: 20px 26px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-header h2 {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
}

.card-body {
    padding: 26px;
}

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

.data-table th {
    text-align: left;
    padding: 15px 22px;
    background: rgba(10, 14, 24, 0.65);
    color: #cbd5e1;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.035);
}

/* ===== BADGES VIBRANTS ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-pending {
    background: rgba(251, 191, 36, 0.16);
    border: 1px solid rgba(251, 191, 36, 0.5);
    color: #fde047;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
}

.badge-justified {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #4ade80;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

/* ===== BOUTONS COLORÉS ===== */
.btn-primary {
    background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
    color: white;
    border: none;
    padding: 11px 24px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.25s;
    box-shadow: 0 4px 18px var(--xmas-red-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(244, 63, 94, 0.6);
}

.btn-sm {
    display: inline-block;
    padding: 7px 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--xmas-gold);
    color: var(--xmas-gold);
    transform: scale(1.03);
}

/* ===== FILTRES & RECHERCHE ===== */
.filter-btn {
    padding: 9px 18px;
    border-radius: 9px;
    background: rgba(16, 22, 36, 0.8);
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, var(--xmas-red) 0%, #be123c 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px var(--xmas-red-glow);
}

.search-form input {
    padding: 10px 16px;
    background: rgba(10, 14, 24, 0.8);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: #fff;
    font-size: 14px;
    min-width: 250px;
    transition: all 0.2s;
}

.search-form input:focus {
    outline: none;
    border-color: var(--xmas-blue);
    box-shadow: 0 0 12px var(--xmas-blue-glow);
}

.search-form button {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--xmas-red) 0%, #be123c 100%);
    color: white;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--xmas-red-glow);
}

/* ===== JUSTIFICATION BOX ===== */
.justification-box {
    background: rgba(10, 14, 24, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid var(--xmas-green);
    border-radius: var(--radius);
    padding: 22px;
}

.justification-meta {
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 14px;
    margin-top: 14px;
}