:root {
    --bg-image: none;
    --glass-filter: none;
    --bg-color: #f0f2f5;
    --column-bg: #f4f5f7;
    --card-bg: #ffffff;
    --text-main: #172b4d;
    --text-muted: #5e6c84;
    --primary: #0052cc;
    --border-color: #dfe1e6;
    --header-bg: linear-gradient(135deg, #091e42 0%, #0052cc 100%);
    --header-text: #ffffff;
    --header-btn-bg: rgba(255, 255, 255, 0.15);
    --header-btn-border: rgba(255, 255, 255, 0.2);
    --shadow-main: 0 4px 20px rgba(9, 30, 66, 0.05);
    --shadow-hover: 0 8px 30px rgba(9, 30, 66, 0.1);
    --border-radius: 6px;
    --card-radius: 12px;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    --col-todo: #ffab00;
    --col-inprogress: #0052cc;
    --col-blocked: #ff5630;
    --col-done: #36b37e;
}

body[data-theme="dark"] {
    --bg-image: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    --glass-filter: blur(12px);
    --bg-color: #111827;
    --column-bg: rgba(31, 41, 55, 0.5);
    --card-bg: rgba(55, 65, 81, 0.6);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #3b82f6;
    --border-color: rgba(255, 255, 255, 0.08);
    --header-bg: linear-gradient(135deg, rgba(31,41,55,0.7) 0%, rgba(17,24,39,0.7) 100%);
    --header-text: #f3f4f6;
    --header-btn-bg: rgba(255, 255, 255, 0.1);
    --header-btn-border: rgba(255, 255, 255, 0.1);
    --shadow-main: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.6);
}

body[data-theme="modern"] {
    --bg-image: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);
    --glass-filter: blur(8px);
    --bg-color: #fafafa;
    --column-bg: rgba(255, 255, 255, 0.7);
    --card-bg: #ffffff;
    --text-main: #18181b;
    --text-muted: #71717a;
    --primary: #6366f1;
    --border-color: rgba(255, 255, 255, 0.6);
    --header-bg: rgba(255, 255, 255, 0.9);
    --header-text: #18181b;
    --header-btn-bg: rgba(99, 102, 241, 0.1);
    --header-btn-border: rgba(99, 102, 241, 0.2);
    --shadow-main: 0 10px 40px rgba(31, 38, 135, 0.07);
    --shadow-hover: 0 15px 50px rgba(31, 38, 135, 0.1);
    --border-radius: 12px;
    --card-radius: 20px;
}

body[data-theme="architect"] {
    --bg-image: none;
    --glass-filter: none;
    --bg-color: #f1f4f6;
    --column-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #3f4254;
    --text-muted: #a1a5b7;
    --primary: #3f6ad8;
    --border-color: rgba(0, 0, 0, 0.05);
    --header-bg: #ffffff;
    --header-text: #3f4254;
    --header-btn-bg: #f5f8fa;
    --header-btn-border: #f5f8fa;
    --shadow-main: 0 0.46875rem 2.1875rem rgba(4,9,20,0.03), 0 0.9375rem 1.40625rem rgba(4,9,20,0.03), 0 0.25rem 0.53125rem rgba(4,9,20,0.05), 0 0.125rem 0.1875rem rgba(4,9,20,0.03);
    --shadow-hover: 0 0.5rem 2.5rem rgba(4,9,20,0.06);
    --border-radius: 0.3rem;
    --card-radius: 0.5rem;
    
    --col-todo: #f6c23e;
    --col-inprogress: #3f6ad8;
    --col-blocked: #e74a3b;
    --col-done: #1cc88a;
}

body { 
    font-family: var(--font-main); 
    background-color: var(--bg-color);
    background-image: var(--bg-image);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-main); 
    margin: 0; 
    padding: 20px 40px; 
}

/* --- En-tête Global Moderne (Couleurs sombres) --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--header-bg);
    color: var(--header-text);
    padding: 16px 24px;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-main);
    margin-bottom: 30px;
    position: sticky;
    top: 20px;
    z-index: 1000;
    backdrop-filter: var(--glass-filter);
    border: 1px solid var(--border-color);
}

.main-header h1 { font-size: 22px; margin: 0; font-weight: 700; color: var(--header-text); display: flex; align-items: center; gap: 12px; }

.header-title-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Logo container adapté au fond sombre */
.app-logo-container {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--header-btn-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--header-btn-border);
    overflow: hidden;
}
.app-logo-container img { max-width: 100%; max-height: 100%; object-fit: contain; }
.app-logo-container svg { color: var(--header-text); }

.header-actions { display: flex; gap: 12px; align-items: center; }

/* Barre de recherche adaptée au fond sombre */
.search-box {
    display: flex;
    align-items: center;
    background: var(--header-btn-bg);
    border: 1px solid var(--header-btn-border);
    border-radius: var(--border-radius);
    padding: 0 12px;
    transition: background 0.2s, border-color 0.2s;
}
.search-box:focus-within { background: var(--header-btn-bg); border-color: var(--primary); }
.search-box input { border: none; background: transparent; padding: 10px 10px; width: 250px; font-size: 14px; color: var(--header-text); outline: none; }
.search-box input::placeholder { color: var(--text-muted); }

/* Boutons d'en-tête */
.btn-header { 
    background: var(--header-btn-bg); color: var(--header-text); border: 1px solid var(--header-btn-border); 
    padding: 10px 18px; border-radius: var(--border-radius); cursor: pointer; font-weight: 600; font-size: 14px;
    transition: background 0.2s, transform 0.1s; display: flex; align-items: center; gap: 8px; text-decoration: none;
}
.btn-header:hover { background: var(--header-btn-bg); transform: translateY(-1px); border-color: var(--primary); }
.btn-new-task { background: #00875a !important; border-color: #00a36c !important; color: white !important; }
.btn-new-task:hover { background: #00a36c !important; }
.btn-logout { background: rgba(222, 53, 11, 0.8) !important; border-color: #de350b !important; color: white !important; }
.btn-logout:hover { background: #de350b !important; }

/* Boutons standard de l'application */
.btn { background: var(--primary); color: white; border: none; padding: 10px 18px; border-radius: var(--border-radius); cursor: pointer; font-weight: 600; font-size: 14px; transition: background 0.2s; }
.btn:hover { opacity: 0.9; }

/* --- Menu Déroulant (Dropdown) dans le Header --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 120%;
    background-color: var(--card-bg);
    min-width: 200px;
    box-shadow: var(--shadow-hover);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    z-index: 2000;
    overflow: hidden;
    backdrop-filter: var(--glass-filter);
}

.dropdown-menu.show {
    display: block;
    animation: fadeInDown 0.2s ease;
}

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

.dropdown-item {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background-color: #f4f5f7;
    color: var(--primary);
}

.dropdown-divider {
    border-top: 1px solid #ebecf0;
    margin: 4px 0;
}

.dropdown-item.text-danger { color: #de350b; }
.dropdown-item.text-danger:hover { background-color: #ffebee; color: #c62828; }

/* --- Layout Principal --- */
.app-layout { display: flex; gap: 25px; align-items: flex-start; }

/* Conteneur principal qui détache la zone des onglets */
.main-content { 
    flex: 1; min-width: 0; 
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-main);
    border: 1px solid var(--border-color);
    backdrop-filter: var(--glass-filter);
}

/* Sidebar d'activité */
.activity-sidebar {
    width: 320px; background: var(--card-bg); border-radius: var(--card-radius); padding: 24px;
    box-shadow: var(--shadow-main); border: 1px solid var(--border-color);
    flex-shrink: 0; position: sticky; top: 120px; max-height: calc(100vh - 140px); overflow-y: auto;
    backdrop-filter: var(--glass-filter);
}
.activity-sidebar h3 { margin: 0 0 20px 0; font-size: 16px; color: var(--text-main); border-bottom: 2px solid var(--border-color); padding-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.activity-item { padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px solid var(--border-color); }
.activity-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0;}
.activity-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.activity-task { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 8px; line-height: 1.4; }
.activity-note { font-size: 12px; color: var(--text-muted); background: var(--column-bg); padding: 10px; border-radius: 6px; border-left: 3px solid var(--primary); white-space: pre-wrap; }

/* Onglets */
.tabs-header { display: flex; gap: 15px; margin-bottom: 25px; border-bottom: 2px solid var(--border-color); padding-bottom: 0; }
.tab-btn { background: none; border: none; font-size: 15px; font-weight: 600; color: var(--text-muted); cursor: pointer; padding: 10px 20px; border-bottom: 3px solid transparent; transition: 0.2s; margin-bottom: -2px; }
.tab-btn:hover { color: var(--text-main); background: var(--column-bg); border-radius: 6px 6px 0 0;}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

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

/* Grille Kanban */
.board { display: flex; gap: 24px; align-items: flex-start; overflow-x: auto; padding-bottom: 10px;}
.column { background: var(--column-bg); border-radius: 10px; flex: 1; min-width: 320px; padding: 16px; min-height: 600px; border-top: 4px solid transparent; border: 1px solid var(--border-color); backdrop-filter: var(--glass-filter); }
#todo { border-top-color: var(--col-todo); }
#in_progress { border-top-color: var(--col-inprogress); }
#blocked { border-top-color: var(--col-blocked); }
#done { border-top-color: var(--col-done); }
.column h3 { margin: 0 0 16px 0; font-size: 15px; color: var(--text-main); font-weight: 600; }
.list { min-height: 500px; }

/* Post-it */
.card { padding: 16px; margin-bottom: 16px; border-radius: 2px 2px 15px 2px / 2px 2px 5px 2px; box-shadow: 2px 4px 6px rgba(0,0,0,0.08); cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; position: relative; border: 1px solid rgba(0,0,0,0.05); }
.card:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: 4px 8px 15px rgba(0,0,0,0.12); }
.color-yellow { background-color: #fff9c4; color: #172b4d; }
.color-blue   { background-color: #e3f2fd; color: #172b4d; }
.color-orange { background-color: #ffe0b2; color: #172b4d; }
.color-pink   { background-color: #fce4ec; color: #172b4d; }
.color-green  { background-color: #e8f5e9; color: #172b4d; }
.color-grey   { background-color: #f5f5f5; color: #172b4d; }
.tags-container { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 12px; display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, 0.65); color: #172b4d; border: 1px solid rgba(0,0,0,0.1); }
.tag-prio { color: #c62828; }
.tag-itbm { background: #e3f2fd; color: #0d47a1; border-color: transparent;}
.card-title { font-size: 14px; font-weight: 600; line-height: 1.5; margin-bottom: 16px; word-wrap: break-word; }
.card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: rgba(0,0,0,0.6); font-weight: 500; }
.card-footer span { display: flex; align-items: center; gap: 4px; }

/* Vue Liste */
.data-table-container { background: white; overflow-x: auto; border: 1px solid #c0c0c0; }
.data-table { width: 100%; border-collapse: collapse; min-width: 1200px; text-align: left; font-family: "Calibri", "Arial", sans-serif; }
.data-table th { background: #f3f2f1; padding: 6px 10px; font-size: 13px; color: #333; font-weight: normal; border: 1px solid #c0c0c0; vertical-align: middle; }
.data-table td { padding: 4px 10px; font-size: 13px; border: 1px solid #c0c0c0; vertical-align: top; color: #000; background: #fff; }
.data-table tr { cursor: pointer; }
.data-table tr:hover td { background: #e6f2fa; }
.table-filter { width: 100%; margin-top: 8px; padding: 8px 6px; font-size: 12px; border: 1px solid #dfe1e6; border-radius: 4px; background: white; color: var(--text-main); outline: none; font-weight: 500;}
.table-filter:focus { border-color: var(--primary); }

.status-badge { font-size: 13px; font-weight: normal; padding: 0; border-radius: 0; display: inline; background: transparent !important; color: inherit !important; }
.status-todo { color: #000; }
.status-in_progress { color: #000; }
.status-blocked { color: #000; }
.status-done { color: #000; }

/* En-têtes triables */
.sortable-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; transition: color 0.2s; padding-bottom: 4px; }
.sortable-header:hover { color: var(--primary); }
.sort-icon { display: inline-block; width: 12px; text-align: center; font-size: 10px; }
.sort-icon.asc::after { content: '▲'; color: var(--primary); }
.sort-icon.desc::after { content: '▼'; color: var(--primary); }
.sort-icon:not(.asc):not(.desc)::after { content: '↕'; color: #dfe1e6; }
.sortable-header:hover .sort-icon:not(.asc):not(.desc)::after { color: #b3bac5; }

/* Vue KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.kpi-card { background: var(--card-bg); padding: 24px; border-radius: var(--card-radius); border: 1px solid var(--border-color); box-shadow: var(--shadow-main); backdrop-filter: var(--glass-filter); }
.kpi-card h3 { margin: 0 0 16px 0; font-size: 14px; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--border-color); padding-bottom: 12px;}
.kpi-value-main { font-size: 42px; font-weight: 800; color: var(--primary); margin-bottom: 8px; display: flex; align-items: baseline; gap: 8px;}
.kpi-value-label { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.kpi-list { list-style: none; padding: 0; margin: 0; }
.kpi-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f4f5f7; font-size: 14px; color: var(--text-main); font-weight: 500;}
.kpi-list li:last-child { border-bottom: none; }
.kpi-count { background: #ebecf0; color: var(--text-main); padding: 2px 10px; border-radius: 12px; font-size: 13px; font-weight: 700;}

/* Modales & Menus */
#context-menu { position: absolute; background: var(--card-bg); border-radius: 6px; box-shadow: var(--shadow-hover); padding: 8px 0; display: none; z-index: 3000; min-width: 200px; border: 1px solid var(--border-color); backdrop-filter: var(--glass-filter); }
.context-menu-item { padding: 12px 20px; cursor: pointer; font-size: 14px; color: var(--text-main); display: flex; align-items: center; gap: 10px; transition: background 0.2s; font-weight: 500;}
.context-menu-item:hover { background: var(--column-bg); color: var(--primary); }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(9, 30, 66, 0.6); backdrop-filter: blur(3px); display: none; justify-content: center; align-items: center; z-index: 4000; }
.modal-content { background: var(--card-bg); border-radius: 12px; padding: 30px; width: 90%; max-width: 900px; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-main); position: relative; backdrop-filter: var(--glass-filter); }
.panel-header-container { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--border-color); padding-bottom: 15px; margin-bottom: 25px; }
.panel-header-title { font-size: 20px; font-weight: 700; color: var(--text-main); margin: 0; display: flex; align-items: center; gap: 12px; }
.close-panel { width: 40px; height: 40px; background: var(--column-bg); color: var(--text-muted); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: bold; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.close-panel:hover { background: #ffebee; color: #d32f2f; transform: scale(1.1); }
.btn-modal-add { background: #e3f2fd; color: #0052cc; border: 1px solid #bbdefb; padding: 8px 16px; font-size: 14px; font-weight: 600; border-radius: 6px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 6px; }
.btn-modal-add:hover { background: #bbdefb; }

/* Formulaires */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 25px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-main); }
.form-group input, .form-group select, .form-group textarea { padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 6px; font-family: inherit; font-size: 14px; background: var(--bg-color); color: var(--text-main); transition: border-color 0.2s;}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); background: var(--card-bg); }

.notes-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; }
.notes-table th { background: var(--column-bg); padding: 14px; text-align: left; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid var(--border-color); }
.notes-table td { padding: 14px; border-bottom: 1px solid var(--border-color); vertical-align: top; color: var(--text-main); }
.notes-table tr:hover { background: var(--bg-color); }
.badge-reunion { background: #e3f2fd; color: #0d47a1; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }

/* Panneau latéral des détails/ajout note */
#details-panel { position: fixed; right: -50vw; top: 0; width: 50vw; height: 100%; background: var(--card-bg); box-shadow: var(--shadow-hover); padding: 40px; transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow-y: auto; z-index: 5000; box-sizing: border-box; backdrop-filter: var(--glass-filter); }
#details-panel.open { right: 0; }
.task-meta-info { display: flex; gap: 15px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.task-meta-info div { background: var(--column-bg); padding: 8px 14px; border-radius: 6px; border: 1px solid var(--border-color);}
.task-meta-info strong { color: var(--text-main); }
.note-meta-inputs { display: flex; gap: 12px; margin-bottom: 16px; }
.note-meta-inputs input, .note-meta-inputs select { padding: 12px; border: 1px solid var(--border-color); border-radius: 6px; font-family: inherit; font-size: 14px; background: var(--bg-color); flex: 1; transition: border-color 0.2s; color: var(--text-main); }
.note-meta-inputs input:focus, .note-meta-inputs select:focus { outline: none; border-color: var(--primary); }
.note-item { background: var(--column-bg); padding: 18px; margin-bottom: 16px; border-radius: 8px; border-left: 4px solid var(--primary); font-size: 14px; line-height: 1.5; color: var(--text-main); }
.note-date { font-weight: 600; color: var(--text-muted); margin-bottom: 10px; font-size: 12px; display: flex; align-items: center; gap: 8px; }

/* --- Styles spécifiques à l'administration avancée --- */
.admin-tabs-header {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: var(--card-bg);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.admin-tab-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: 0.2s;
}
.admin-tab-btn:hover { background: var(--column-bg); color: var(--text-main); }
.admin-tab-btn.active { background: var(--primary); color: white; }

.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* Éditeur JSON */
.json-editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.json-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-main);
    display: flex;
    flex-direction: column;
    gap: 15px;
    backdrop-filter: var(--glass-filter);
}

.json-textarea {
    width: 100%;
    height: 450px;
    font-family: "Courier New", Courier, monospace;
    font-size: 13px;
    padding: 14px;
    border: 1px solid #dfe1e6;
    border-radius: 6px;
    background: #272822;
    color: #f8f8f2;
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.5;
}
.json-textarea:focus { outline: none; border-color: var(--primary); }

/* Zone d'import/export */
.backup-zone {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.backup-card {
    flex: 1;
    min-width: 300px;
    background: var(--card-bg);
    border-radius: var(--card-radius);
    padding: 30px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-main);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    backdrop-filter: var(--glass-filter);
}

.file-upload-wrapper {
    position: relative;
    width: 100%;
    padding: 30px 20px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.2s;
}
.file-upload-wrapper:hover { background: var(--column-bg); border-color: var(--primary); }
.file-upload-wrapper input[type="file"] { width: 100%; height: 100%; position: absolute; top:0; left:0; opacity: 0; cursor: pointer; }

/* Alertes d'état */
.alert-banner {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 600;
    font-size: 14px;
}
.alert-success { background-color: #e3fcef; color: #006644; border: 1px solid #abf5d1; }
.alert-danger { background-color: #ffebee; color: #de350b; border: 1px solid #ffcdd2; }

/* --- Styles pour les Lots / Sous-tâches --- */
.lot-card { 
    background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; 
    padding: 12px 16px; margin-bottom: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); backdrop-filter: var(--glass-filter); 
}
.lot-header { 
    display: flex; justify-content: space-between; align-items: center; 
}
.lot-title { font-weight: 700; color: #091e42; font-size: 14px; }
.lot-code { 
    background: #e3f2fd; color: #0052cc; padding: 4px 8px; 
    border-radius: 4px; font-size: 11px; font-weight: bold; border: 1px solid #bbdefb;
}
.note-target-badge {
    background: #e8f5e9; color: #006644; padding: 2px 6px; 
    border-radius: 4px; font-size: 10px; font-weight: bold; border: 1px solid #b7eb8f;
    margin-right: 6px;
}

/* Loading Overlay au démarrage */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #dfe1e6;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* --- Admin Styles --- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.admin-card { background: white; padding: 25px; border-radius: 12px; box-shadow: 0 4px 20px rgba(9, 30, 66, 0.05); border: 1px solid #ebecf0;}
.admin-card h3 { margin-top: 0; color: #091e42; font-size: 16px; font-weight: 600; border-bottom: 2px solid #f4f5f7; padding-bottom: 12px; margin-bottom: 20px;}
.item-list { list-style: none; padding: 0; margin: 0 0 20px 0; }
.item-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: #f4f5f7; margin-bottom: 8px; border-radius: 4px; font-size: 14px; border: 1px solid #ebecf0;}
.item-list li button { background: #ffebee; border: none; color: #d32f2f; cursor: pointer; font-weight: bold; border-radius: 4px; padding: 4px 8px; transition: background 0.2s;}
.item-list li button:hover { background: #ffcdd2; }
.add-group { display: flex; flex-direction: column; gap: 10px; }
.add-group input { width: 100%; padding: 10px; border: 1px solid #dfe1e6; border-radius: 4px; font-size: 14px; box-sizing: border-box;}
.add-group input:focus { outline: none; border-color: var(--primary); }

.form-group-admin label { font-size: 13px; font-weight: 600; color: #172b4d; display: block; margin-bottom: 6px; }
.form-group-admin input, .form-group-admin select { width: 100%; padding: 10px; border: 1px solid #dfe1e6; border-radius: 4px; font-size: 14px; box-sizing: border-box; background: #fafbfc;}
.form-group-admin input:focus, .form-group-admin select:focus { border-color: var(--primary); outline: none; background: white;}

.file-upload-wrapper {
    position: relative;
    width: 100%;
    padding: 40px 20px;
    border: 2px dashed #dfe1e6;
    border-radius: 8px;
    background: #fafbfc;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.2s, border-color 0.2s;
    text-align: center;
    margin-bottom: 15px;
}
.file-upload-wrapper:hover { background: #f4f5f7; border-color: var(--primary); }
.file-upload-wrapper input[type="file"] { width: 100%; height: 100%; position: absolute; top:0; left:0; opacity: 0; cursor: pointer; }

.color-swatch { width: 24px; height: 24px; border-radius: 4px; cursor: pointer; border: 2px solid transparent; transition: transform 0.1s;}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected { border-color: #172b4d; box-shadow: 0 0 0 2px white inset; }
.project-badge { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; }

.admin-sub-tabs-header { display: flex; gap: 4px; margin-bottom: 25px; flex-wrap: wrap; border-bottom: 2px solid #dfe1e6; padding-left: 5px; }
.admin-sub-tab-btn { background: #f4f5f7; border: 1px solid #dfe1e6; border-bottom: none; padding: 10px 18px; cursor: pointer; font-size: 14px; font-weight: 600; color: #5e6c84; border-radius: 6px 6px 0 0; transition: 0.2s; margin-bottom: -2px; }
.admin-sub-tab-btn:hover { background: #ebecf0; color: #172b4d; }
.admin-sub-tab-btn.active { background: white; color: #0052cc; border: 2px solid #dfe1e6; border-bottom: 2px solid white; box-shadow: 0 -2px 10px rgba(0,0,0,0.02); }
.admin-sub-content { display: none; }
.admin-sub-content.active { display: block; animation: fadeIn 0.3s ease; }
/* Styles pour la page d'Aide (Markdown) */
.markdown-body { color: var(--text-main); font-size: 15px; line-height: 1.6; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: var(--primary); margin-top: 1.5em; margin-bottom: 0.5em; border-bottom: 1px solid var(--border-color); padding-bottom: 5px; }
.markdown-body h1 { font-size: 2em; border-bottom: 2px solid var(--primary); }
.markdown-body h2 { font-size: 1.5em; }
.markdown-body h3 { font-size: 1.25em; border: none; }
.markdown-body p, .markdown-body ul, .markdown-body ol { margin-bottom: 1em; }
.markdown-body img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border-color); display: block; margin: 15px auto; box-shadow: var(--shadow-main); }
.markdown-body blockquote { margin: 1.5em 0; padding: 10px 20px; color: #5e6c84; border-left: 4px solid var(--primary); background: var(--column-bg); border-radius: 4px; }
.markdown-body code { background: var(--column-bg); padding: 2px 5px; border-radius: 4px; font-family: monospace; font-size: 0.9em; border: 1px solid var(--border-color); }
.markdown-body hr { height: 2px; border: none; background-color: var(--border-color); margin: 30px 0; }
