:root {
    --primary: #2563EB;
    --bg-sidebar: linear-gradient(180deg, #475569 0%, #334155 100%);
    --bg-main: #F8FAFC;
    --card: #FFFFFF;
    --text-main: #1E293B;
    --text-sec: #64748B;
    --border: #E2E8F0;
    --warning: #F59E0B;
}

* { box-sizing: border-box; }
body, html { margin: 0; padding: 0; font-family: 'DM Sans', sans-serif; background: var(--bg-main); color: var(--text-main); height: 100vh; overflow: hidden; }

.app-wrapper { display: flex; height: 100vh; transition: 0.3s; }

/* --- SIDEBAR --- */
aside { width: 280px; background: var(--bg-sidebar); padding: 30px 15px; display: flex; flex-direction: column; color: #F8FAFC; height: 100vh; flex-shrink: 0; }
.logo-area { flex-shrink: 0; margin-bottom: 30px; }
.logo { display: flex; align-items: center; gap: 45px; margin-left: 20px; }
.logo-img { width: 50px; height: 50px; object-fit: contain; border-radius: 8px; }
.logo-text { font-weight: 800; font-size: 22px; line-height: 1.2; color: #FFFFFF; text-transform: uppercase; letter-spacing: 0.5px; }

.nav-scroll { flex-grow: 1; overflow-y: auto; }
.nav-group-title { font-size: 10px; font-weight: 800; color: #CBD5E1; text-transform: uppercase; letter-spacing: 2px; margin: 25px 0 12px 10px; opacity: 0.8; }
.nav-item { padding: 14px 16px; border-radius: 12px; cursor: pointer; color: #E2E8F0; margin-bottom: 8px; transition: 0.2s; display: flex; align-items: center; gap: 12px; }
.nav-item:hover { background: rgba(255, 255, 255, 0.1); }
.nav-item.active { background: #FFFFFF; color: var(--primary); font-weight: 700; }
.badge-count { margin-left: auto; background: rgba(0,0,0,0.15); color: #FFFFFF; padding: 2px 8px; border-radius: 6px; font-size: 11px; }

.sidebar-footer { flex-shrink: 0; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.1); }
.btn-midnight { width: 100%; background: rgba(255,255,255,0.15); color: white; border-radius: 14px; padding: 16px; font-weight: 700; cursor: pointer; border: none; transition: 0.2s; }
.btn-midnight:hover { background: #EF4444; }

/* --- MAIN CONTENT --- */
main { flex: 1; padding: 40px; overflow-y: auto; }
.header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin: 0px 0 0px 0;
    position: relative;
}

.floating-image {
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: auto;
    object-fit: contain;
    background: transparent;
    z-index: 10;
}

main {
    position: relative;
}

.btn-edit { 
    border: none !important; 
    background: none !important; 
    cursor: pointer !important; 
    font-size: 14px !important; 
    color: #000000 !important; 
    opacity: 0.8 !important;
}

.btn-delete { 
    border: none !important; 
    background: none !important; 
    cursor: pointer !important; 
    font-size: 14px !important; 
    color: #EF4444 !important;
}
.prog-box { background: white; padding: 25px; border-radius: 16px; border: 1px solid var(--border); margin-bottom: 35px; }
.bar-bg { height: 10px; background: #E2E8F0; border-radius: 10px; margin-top: 12px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--primary); width: 0%; transition: 0.8s ease; }

/* --- LE BOARD & COLONNES --- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; align-items: start; }
.column { background: #EDF2F7; border-radius: 20px; padding: 20px; min-height: 60vh; transition: 0.2s; border: 2px dashed transparent; }
.column.drag-over { border-color: var(--primary); background: #E2E8F0; transform: scale(1.01); }

.col-header { font-weight: 800; font-size: 13px; text-transform: uppercase; color: var(--text-sec); padding-bottom: 15px; border-bottom: 2px solid rgba(0,0,0,0.05); margin-bottom: 20px; display: flex; justify-content: space-between; }
.charge-alert { color: #EF4444; font-size: 11px; font-weight: 800; margin-bottom: 15px; padding: 10px; background: #FEE2E2; border-radius: 8px; display: none; }

/* --- LES CARTES DE MISSIONS --- */
.task-card { background: white; border: 1px solid var(--border); padding: 10px; border-radius: 16px; margin-bottom: 15px; cursor: grab; transition: 0.2s; position: relative; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.task-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.task-card:active { cursor: grabbing; }
.task-card.done { background: #F0FDF4; opacity: 0.6; border-color: #10B981; text-decoration: line-through; }

.task-time { font-size: 11px; font-weight: 800; color: var(--primary); background: #DBEAFE; padding: 3px 8px; border-radius: 20px; display: inline-block; margin-bottom: 8px; }
.task-card h4 { margin: 0 0 10px 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }

/* --- LES ICONES GOOGLE --- */
.task-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.task-link:hover { background: #F8FAFC; border-color: var(--primary); transform: scale(1.15); }
.task-link img { display: block; }

.tag { font-size: 10px; background: #F1F5F9; padding: 4px 8px; border-radius: 6px; font-weight: 700; color: var(--text-sec); }
.escalated-icon { color: var(--warning); font-weight: bold; }

/* --- MODAL (POPUP) --- */
.modal { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(6px); }
.modal-content { background: white; padding: 35px; border-radius: 24px; width: 450px; display: flex; flex-direction: column; gap: 15px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.btn-p { background: var(--primary); color: white; border: none; padding: 14px 22px; border-radius: 12px; font-weight: 700; cursor: pointer; transition: 0.2s; }
.btn-p:hover { background: #1D4ED8; transform: translateY(-1px); }

input, select { padding: 14px; border-radius: 10px; border: 1px solid var(--border); outline: none; font-family: inherit; font-size: 14px; }
input:focus, select:focus { border-color: var(--primary); }

.day-picker { display: flex; justify-content: space-between; margin: 10px 0; }
.day-circle { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; cursor: pointer; font-weight: 700; transition: 0.2s; }
.day-circle.active { background: var(--primary); color: white; border-color: var(--primary); }

/* --- MODE ZEN & FOCUS --- */
.btn-focus { position: fixed; bottom: 30px; right: 30px; background: #1E293B; color: white; border-radius: 30px; border: none; padding: 12px 25px; cursor: pointer; z-index: 100; font-weight: 700; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3); transition: 0.2s; }
.btn-focus:hover { background: var(--primary); transform: scale(1.05); }

.zen-mode aside { width: 0; padding: 0; opacity: 0; }
.zen-mode .prog-box, .zen-mode .header, .zen-mode .column:not(#col-3) { display: none; }
.zen-mode .board { grid-template-columns: 1fr; max-width: 600px; margin: 50px auto; }
.task-link img {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Si l'image casse, on cache le cadre */
.task-link img[src=""], .task-link img:not([src]) {
    visibility: hidden;
}
.task-link img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
    /* Empêche l'image d'être floue si elle est petite */
    image-rendering: -webkit-optimize-contrast; 
}