:root {
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --color-primary: #1e3a8a;
    --color-primary-dark: #0f172a;
    --color-accent: #f59e0b;
    --color-accent-hover: #d97706;
    --color-bg-subtle: #f8fafc;
    --color-border: #e2e8f0;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 12px 24px -4px rgba(15, 23, 42, 0.12);
}

body {
    font-family: var(--font-main);
    background-color: #f1f5f9;
    color: #1e293b;
    min-height: 100vh;
}

/* --- Écran de Connexion --- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 36px 32px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 4px;
}

/* --- Tableau de Bord Admin --- */
.admin-navbar {
    background: #0f172a;
    border-bottom: 3px solid var(--color-accent);
    padding: 12px 0;
}

.admin-nav-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 8px;
    padding: 2px;
}

.card-custom {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 18px 20px;
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* --- Carte Actualité dans l'admin --- */
.admin-news-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.admin-news-thumb-wrapper {
    position: relative;
    height: 180px;
    background: #e2e8f0;
    overflow: hidden;
}

.admin-news-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.admin-news-date-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ffffff;
    border-radius: 8px;
    padding: 4px 10px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    line-height: 1.1;
}

.admin-news-date-badge .day {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-primary);
    display: block;
}

.admin-news-date-badge .month {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
}

.admin-news-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.admin-news-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 10px 0 8px 0;
    line-height: 1.35;
    color: #0f172a;
}

.admin-news-excerpt {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
    flex-grow: 1;
}

.admin-news-footer {
    border-top: 1px solid #f1f5f9;
    padding: 12px 18px;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* --- Galerie de sélection d'images --- */
.preset-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    max-height: 230px;
    overflow-y: auto;
    padding: 8px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid var(--color-border);
}

.preset-thumb-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    height: 80px;
    transition: all 0.2s ease;
}

.preset-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preset-thumb-item:hover {
    border-color: var(--color-primary);
    transform: scale(1.03);
}

.preset-thumb-item.selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.preset-thumb-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Prévisualisation carte --- */
.preview-box {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 16px;
}

.image-preview-thumb {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

.live-card-image-wrapper {
    height: 180px;
    overflow: hidden;
    background: #e2e8f0;
}

.live-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-card-day {
    font-size: 1.1rem;
    line-height: 1;
}

.live-card-month {
    font-size: 0.7rem;
}

.live-card-tag {
    font-size: 0.75rem;
}

.live-card-excerpt {
    line-height: 1.4;
}

/* Zone de téléversement Drag & Drop */
.dropzone-area {
    border: 2px dashed #94a3b8;
    border-radius: 12px;
    background: #f8fafc;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone-area:hover,
.dropzone-area.dragover {
    border-color: var(--color-primary);
    background: #eff6ff;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1080;
}

.admin-toast {
    border-radius: 12px;
    min-width: 300px;
}

.admin-modal-content {
    border-radius: 16px;
}

.admin-modal-header {
    border-radius: 16px 16px 0 0;
}

/* --- Section Pièces Jointes & Upload de Documents --- */
.doc-dropzone-area {
    border: 2px dashed #94a3b8;
    border-radius: 12px;
    background: #f8fafc;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.doc-dropzone-area:hover,
.doc-dropzone-area.dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

.attached-doc-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.attached-doc-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #ffffff;
    font-size: 1.25rem;
    line-height: 1;
}

.attached-doc-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doc-badge-pdf {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.doc-badge-word {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.doc-badge-excel {
    background: linear-gradient(135deg, #10b981, #047857);
}

.doc-badge-powerpoint {
    background: linear-gradient(135deg, #f97316, #c2410c);
}

.doc-badge-video {
    background: linear-gradient(135deg, #e11d48, #9f1239);
}

.doc-badge-audio {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.doc-badge-generic {
    background: linear-gradient(135deg, #64748b, #334155);
}

.doc-badge-label {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Badge Document dans la carte admin */
.admin-card-attachments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.admin-card-attachment {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-top: 0;
}

.admin-card-attachment:hover {
    background: #e2e8f0;
}

