:root {
    --bg-color: #f4f5f7;
    --column-bg: #ebecf0;
    --text-main: #172b4d;
    --text-muted: #5e6c84;
    --primary: #0052cc;
    --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 { 
    font-family: var(--font-main); 
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-main); 
    margin: 0; 
    padding: 20px 40px; 
}

h1 { font-size: 24px; margin-bottom: 0; font-weight: 700; color: #091e42; }

/* --- En-tête Global Moderne --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(9, 30, 66, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 30px;
    /* Propriétés pour fixer le header au scroll */
    position: sticky;
    top: 20px;
    z-index: 1000;
}

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

.app-logo-container {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #dfe1e6;
    overflow: hidden;
}

.app-logo-container img { max-width: 100%; max-height: 100%; object-fit: contain; }
.app-logo-container svg { color: var(--primary); }

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

/* Barre de recherche */
.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #dfe1e6;
    border-radius: 6px;
    padding: 0 12px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 82, 204, 0.1); }
.search-box input { border: none; background: transparent; padding: 10px 10px; width: 250px; font-size: 14px; color: var(--text-main); outline: none; }

/* Boutons */
.btn { 
    background: var(--primary); color: white; border: none; padding: 10px 18px; 
    border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 14px;
    transition: background 0.2s, transform 0.1s; display: flex; align-items: center; gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.btn:hover { background: #0047b3; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Layout Principal */
.app-layout { display: flex; gap: 25px; align-items: flex-start; }
.main-content { flex: 1; min-width: 0; }

/* Sidebar d'activité */
.activity-sidebar {
    width: 320px; background: rgba(255, 255, 255, 0.95); border-radius: 12px; padding: 24px;
    box-shadow: 0 4px 20px rgba(9, 30, 66, 0.05); border: 1px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0; 
    /* Propriétés pour fixer la sidebar en dessous du header */
    position: sticky; 
    top: 120px; 
    max-height: calc(100vh - 140px); 
    overflow-y: auto;
}
.activity-sidebar h3 { margin: 0 0 20px 0; font-size: 16px; color: #091e42; border-bottom: 2px solid #f4f5f7; padding-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.activity-item { padding-bottom: 15px; margin-bottom: 15px; border-bottom: 1px solid #ebecf0; }
.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: #f4f5f7; 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 #dfe1e6; 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: rgba(255, 255, 255, 0.5); 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: 20px;}
.column { background: rgba(235, 236, 240, 0.7); border-radius: 10px; width: 320px; min-width: 320px; padding: 16px; min-height: 600px; border-top: 4px solid transparent; backdrop-filter: blur(4px);}
#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: rgba(255, 255, 255, 0.95); border-radius: 10px; box-shadow: 0 4px 20px rgba(9, 30, 66, 0.05); overflow-x: auto; border: 1px solid rgba(255,255,255,0.5);}
.data-table { width: 100%; border-collapse: collapse; min-width: 1000px; text-align: left; }
.data-table th { background: #fafbfc; padding: 12px 16px; font-size: 12px; color: var(--text-muted); font-weight: 700; border-bottom: 2px solid #dfe1e6; text-transform: uppercase; vertical-align: top;}
.data-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid #ebecf0; vertical-align: middle; }
.data-table tr { transition: background 0.2s; cursor: pointer; }
.data-table tr:hover { background: #f4f5f7; }
.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: 12px; font-weight: 700; padding: 4px 8px; border-radius: 4px; display: inline-block;}
.status-todo { background: #fffae6; color: #ff8b00; }
.status-in_progress { background: #e3f2fd; color: #0052cc; }
.status-blocked { background: #ffebee; color: #de350b; }
.status-done { background: #e3fcef; color: #006644; }

/* Vue KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.kpi-card { background: rgba(255, 255, 255, 0.95); padding: 24px; border-radius: 12px; box-shadow: 0 4px 20px rgba(9, 30, 66, 0.05); border: 1px solid rgba(255,255,255,0.5); }
.kpi-card h3 { margin: 0 0 16px 0; font-size: 14px; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid #ebecf0; 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: white; border-radius: 6px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); padding: 8px 0; display: none; z-index: 3000; min-width: 200px; border: 1px solid #dfe1e6; }
.context-menu-item { padding: 12px 20px; cursor: pointer; font-size: 14px; color: #172b4d; display: flex; align-items: center; gap: 10px; transition: background 0.2s; font-weight: 500;}
.context-menu-item:hover { background: #f4f5f7; 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: white; border-radius: 12px; padding: 30px; width: 90%; max-width: 900px; max-height: 85vh; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.2); position: relative; }

/* En-têtes de Panneaux/Modales */
.panel-header-container { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #ebecf0; padding-bottom: 15px; margin-bottom: 25px; }
.panel-header-title { font-size: 20px; font-weight: 700; color: #091e42; margin: 0; display: flex; align-items: center; gap: 12px; }
.close-panel { width: 40px; height: 40px; background: #f4f5f7; color: #5e6c84; 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 #dfe1e6; border-radius: 6px; font-family: inherit; font-size: 14px; background: #fafbfc; 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: white; }

.notes-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 14px; }
.notes-table th { background: #f4f5f7; padding: 14px; text-align: left; color: #5e6c84; font-weight: 600; border-bottom: 2px solid #dfe1e6; }
.notes-table td { padding: 14px; border-bottom: 1px solid #dfe1e6; vertical-align: top; color: var(--text-main); }
.notes-table tr:hover { background: #fafbfc; }
.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: white; box-shadow: -5px 0 25px rgba(0,0,0,0.15); padding: 40px; transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow-y: auto; z-index: 5000; box-sizing: border-box; }
#details-panel.open { right: 0; }
.task-meta-info { display: flex; gap: 15px; flex-wrap: wrap; font-size: 13px; color: #5e6c84; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid #ebecf0; }
.task-meta-info div { background: #f4f5f7; padding: 8px 14px; border-radius: 6px; border: 1px solid #dfe1e6;}
.task-meta-info strong { color: #172b4d; }
.note-meta-inputs { display: flex; gap: 12px; margin-bottom: 16px; }
.note-meta-inputs input, .note-meta-inputs select { padding: 12px; border: 1px solid #dfe1e6; border-radius: 6px; font-family: inherit; font-size: 14px; background: #fafbfc; flex: 1; transition: border-color 0.2s;}
.note-meta-inputs input:focus, .note-meta-inputs select:focus { outline: none; border-color: var(--primary); }
.note-item { background: #f4f5f7; 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; }
