/* --- FontAwesome icons for model form fields --- */
.field-actions i.fa {
    font-size: 1.3em;
    color: #8795ad;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    padding: 5px;
    border-radius: 4px;
    user-select: none;
}

.field-actions i.fa:hover {
    color: #4464c6;
    background: #eef3fb;
}

.form-label {
    margin-bottom: 0.5rem;
}

/* Align "Champs du modèle* :" label with "Nom du modèle*" input */
.form-label-fields {
    display: inline-block;
    min-width: 300px;
    font-weight: 600;
    vertical-align: top;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding-top: 0.45rem;
    box-sizing: border-box;
    padding-left: 8px;
}

.models-list-search-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

body {
    margin: 0;
    font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
    background: #f5f6f8;
    color: #222;
}

/* ===== SIDEBAR ===== */
.app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: #272E40;
    color: #a4b4c9;
    z-index: 1050;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 20px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo img {
    height: 42px;
    max-width: 180px;
    object-fit: contain;
    filter: brightness(1.1);
}

.sidebar-user-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #4f8cff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-user-name {
    color: #e0e7ef;
    font-weight: 600;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: #6b7f99;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== SIDEBAR ZOOM CONTROL ===== */
.sidebar-zoom-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.zoom-btn {
    border: none;
    background: rgba(255,255,255,0.08);
    color: #8795ad;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
}
.zoom-btn:hover {
    background: rgba(255,255,255,0.14);
    color: #e0e7ef;
}
.zoom-btn:active {
    background: rgba(79, 140, 255, 0.25);
    color: #fff;
}
.zoom-btn i { font-size: 9px; }
.zoom-letter { font-size: 13px; }
.zoom-btn-minus .zoom-letter { font-size: 11px; }
.zoom-btn-plus .zoom-letter { font-size: 15px; }
.zoom-btn-reset {
    min-width: 44px;
    font-size: 11px;
    color: #5f7089;
    letter-spacing: 0.3px;
}
.zoom-btn-reset:hover { color: #4f8cff; }

.sidebar-nav {
    flex: 1;
    padding: 8px 0 20px;
}

.sidebar-group-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #5f7089;
    padding: 18px 20px 6px;
    font-weight: 700;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #a4b4c9;
    font-size: 0.93rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.85;
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.05);
    color: #e0e7ef;
}

.sidebar-menu li a.active {
    background: rgba(79, 140, 255, 0.12);
    color: #fff;
    border-left-color: #4f8cff;
    font-weight: 600;
}

.sidebar-menu li a.active i {
    opacity: 1;
    color: #4f8cff;
}

/* ── Sidebar Sub-menus ── */
.sidebar-has-submenu > .sidebar-submenu-toggle {
    position: relative;
    cursor: pointer;
}
.sidebar-submenu-toggle .sidebar-submenu-arrow {
    margin-left: auto;
    font-size: 0.65rem;
    opacity: 0.5;
    transition: transform 0.25s ease;
}
.sidebar-has-submenu.open > .sidebar-submenu-toggle .sidebar-submenu-arrow {
    transform: rotate(180deg);
}
.sidebar-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.15);
}
.sidebar-has-submenu.open > .sidebar-submenu {
    max-height: 500px;
}
.sidebar-submenu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px 8px 36px;
    color: #8a9bb5;
    font-size: 0.84rem;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}
.sidebar-submenu li a i {
    width: 16px;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
}
.sidebar-submenu li a:hover {
    background: rgba(255,255,255,0.04);
    color: #c8d5e3;
}
.sidebar-submenu li a.active {
    background: rgba(79, 140, 255, 0.08);
    color: #e0e9f5;
    border-left-color: #4f8cff;
    font-weight: 500;
}
.sidebar-submenu li a.active i {
    opacity: 1;
    color: #4f8cff;
}

/* Sidebar mobile overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== TOPBAR ===== */
.app-topbar {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    z-index: 1030;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #495057;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    margin-right: 12px;
    transition: background 0.15s;
}

.topbar-toggle:hover {
    background: #f0f2f5;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #343a40;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== MAIN WRAPPER ===== */
.app-main {
    margin-left: 260px;
    padding-top: 60px;
    min-height: 100vh;
    background: #f5f6f8;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    padding: 24px;
}

/* ===== APP FOOTER ===== */
.app-footer {
    text-align: center;
    padding: 18px 24px 24px;
    color: #6b7280;
    font-size: 0.88rem;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.app-footer nav {
    margin-top: 0.3rem;
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.app-footer a {
    color: #4f8cff;
    font-weight: 600;
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* ===== TOGGLE SWITCH (user menu) ===== */
.toggle-switch {
    border: none;
    border-radius: 99px;
    padding: 2px;
    width: 36px;
    height: 20px;
    background: #cbd5e1;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-switch.is-active {
    background: #4f8cff;
}

.toggle-knob {
    display: block;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.2s;
}

.toggle-switch.is-active .toggle-knob {
    left: 18px;
}

.menu-item-toggle {
    padding: 7px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #343a40;
    cursor: default;
}

.menu-divider {
    height: 1px;
    background: #e9ecef;
    margin: 4px 12px;
}

/* ===== RESPONSIVE SIDEBAR ===== */
@media (max-width: 992px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .app-topbar {
        left: 0;
    }
    .topbar-toggle {
        display: block;
    }
    .app-content {
        padding: 16px;
    }
}

@media (max-width: 600px) {
    .app-content {
        padding: 10px;
    }
    .topbar-title {
        font-size: 1rem;
    }
    .task-view {
        width: 100%;
        max-width: 100%;
        margin: 0 0 2rem;
    }
    .task-view-hero,
    .task-view-description-block,
    .task-mission-share,
    .task-panel {
        padding: 1rem 1.2rem;
        border-radius: 16px;
    }
    .task-view-buttons {
        width: 100%;
        flex-direction: column;
    }
    .task-view-buttons .btn-secondary,
    .task-view-buttons a {
        width: 100%;
        justify-content: center;
    }
}

/* ===== NON-LOGGED HEADER (public pages) ===== */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #272E40;
    color: #fff;
    padding: 0 1.5rem;
    height: 60px;
}

.logo {
    font-weight: bold;
    font-size: 1.4rem;
    letter-spacing: 2px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    font-size: 0.92rem;
    margin-right: 0.5rem;
    color: #6b7f99;
}

@media (max-width: 768px) {
    .user-info {
        display: none;
    }
}

.btn-login,
.btn-logout {
    color: #fff;
    background: #4f8cff;
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-login:hover,
.btn-logout:hover {
    background: #3d7bf7;
}

/* NON-LOGGED main content (public pages, landing uses its own) */
.main-content {
    max-width: 1200px;
    margin: 2rem auto 0 auto;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    min-height: 60vh;
}

@media (max-width: 900px) {
    .main-content {
        margin: 1rem;
        padding: 1rem;
    }
}

@media (max-width: 600px) {
    .main-content {
        margin: 0;
        padding: 0.8rem 0.7rem 1.5rem;
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
    }

    .logo {
        font-size: 1.1rem;
    }
}

/* Menu icon (used in user dropdown) */
.menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    font-size: 0.85em;
    color: #64748b;
    vertical-align: middle;
}
.user-menu a:hover .menu-icon,
.user-menu .logout:hover .menu-icon {
    color: inherit;
}

a {
    color: #0073e6;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ----- Login & Register Form Card (inline in app-content) ----- */
.login-card {
    max-width: 400px;
    margin: 3rem auto 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    padding: 2rem 2rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
}

.login-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.3rem;
    color: #1e293b;
    text-align: center;
}

.login-form label {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.2rem;
    font-size: 1rem;
    color: #232a3b;
    font-weight: 500;
}

.login-form input[type="email"],
.login-form input[type="password"] {
    margin-top: 0.4em;
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-form input:focus {
    outline: none;
    border-color: #4f8cff;
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.12);
    background: #fff;
}

.btn-primary {
    width: 100%;
    padding: 0.85em 0;
    background: #4f8cff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.7em;
}

.btn-primary:hover {
    background: #3d7bf7;
}

.login-help {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #64748b;
}

.login-help a {
    color: #4f8cff;
    font-weight: 600;
}

.static-page-card {
    max-width: 820px;
    margin: 2.5rem auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    padding: 2.5rem;
}

.static-page-card h1 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: #0f172a;
}

.static-page-card article {
    margin-bottom: 1.5rem;
}

.static-page-card h2 {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
    color: #1d2a44;
}

.static-page-card p {
    margin: 0;
    color: #4a5164;
    line-height: 1.6;
}

.static-intro {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.static-grid {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 1.5rem;
}

.static-highlight {
    background: #f4f6fb;
    border-radius: 12px;
    padding: 1.2rem 1.6rem;
    border: 1px solid #e2e8f0;
}

.static-highlight h3 {
    margin-top: 0;
    margin-bottom: 0.6rem;
    color: #0f172a;
}

.site-footer {
    text-align: center;
    margin-top: 2.5rem;
    padding: 1.5rem 0 2rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.site-footer nav {
    margin-top: 0.3rem;
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.site-footer a {
    color: #4f8cff;
    font-weight: 600;
}

.model-page {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.model-section {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.model-section-head {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.model-section-head h1 {
    margin: 0;
}

.model-head-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    align-items: center;
}

.model-search {
    padding: 0.65rem 1rem;
    border-radius: 999px;
    border: 1px solid #d7dce8;
    min-width: 220px;
}

.model-cards {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.model-card {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.model-card header {
    display: flex;
    justify-content: space-between;
    gap: 0.9rem;
    align-items: flex-start;
}

.model-card-actions a {
    margin-left: 0.4rem;
    color: #94a3b8;
}

.model-card-actions a:hover {
    color: #1d4ed8;
}

.model-card footer {
    margin-top: auto;
}

.btn-secondary.btn-icon,
.btn-primary.btn-icon {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    background: #1d4ed8;
    color: #fff;
    border: none;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: inherit;
    line-height: 1.4;
    height: auto;
    box-sizing: border-box;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary.btn-icon:hover,
.btn-secondary.btn-icon:hover {
    background: #1e40af;
}

.btn-light {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    background: #eef2ff;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    color: #1d4ed8;
}

.btn-sm {
    padding: 0.35rem 0.75rem !important;
    font-size: 0.9rem !important;
    gap: 0.3rem !important;
}

.empty-state {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #d2d9e8;
}

.model-field-tags {
    list-style: none;
    padding: 0;
    margin: 0.3rem 0 0 0;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.model-field-tags li {
    background: #f4f6fb;
    color: #1e293b;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.85rem;
}

.model-field-tags li.more {
    background: #e0e7ff;
    color: #3730a3;
}

.model-table-legacy {
    margin-top: 1rem;
    overflow-x: auto;
}

.model-table-legacy table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.model-table-legacy th,
.model-table-legacy td {
    border-bottom: 1px solid #e2e8f0;
    padding: 0.6rem;
    text-align: left;
}

.model-table-legacy td:last-child {
    text-align: center;
}

.table-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    margin: 0 0.15rem;
}

.table-icon:hover {
    background: #e0e7ff;
    color: #1d4ed8;
}

.table-icon.danger {
    background: #fee2e2;
    color: #dc2626;
}

.table-icon.danger:hover {
    background: #fecaca;
    color: #b91c1c;
}

.task-template-form {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    max-width: 960px;
    margin: 0 auto;
}

.task-panel-head.template-head-inline {
    flex-direction: column;
    gap: 0.4rem;
}

.template-head-inline .template-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.template-head-inline .template-head-row h1 {
    margin: 0;
}

.template-head-inline .template-back-link {
    text-decoration: none;
    font-weight: 600;
    color: #1d3fbf;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #cfd6ed;
    transition: background .15s;
}

.template-head-inline .template-back-link:hover {
    background: #edf1ff;
}

.task-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.task-template-builder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.template-category {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem;
    background: #fdfdff;
}

.template-category-head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.template-category-head input {
    flex: 1;
    padding: 0.55rem 0.8rem;
    border-radius: 10px;
    border: 1px solid #d7dce8;
    font-weight: 600;
}

.template-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.template-task {
    border: 1px solid #e3e8f5;
    border-radius: 12px;
    padding: 0.8rem;
    background: #fff;
    max-width: 100%;
    box-sizing: border-box;
}

.template-task input,
.template-task textarea {
    width: 100%;
    border: 1px solid #dfe3ef;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
}

.template-task textarea {
    min-height: 80px;
    resize: vertical;
}

.btn-icon-only {
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 0.25rem 0.35rem;
    cursor: pointer;
}

.builder-actions {
    margin-top: 1.5rem;
}

.task-template-apply-form select {
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: 1px solid #d7dce8;
}

.apply-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.apply-category {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.2rem;
    background: #fdfdfd;
}

.apply-category header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.apply-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.apply-category label {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
}

.apply-category strong {
    color: #0f172a;
}

.apply-category em {
    display: block;
    font-style: normal;
    color: #6b7280;
    font-size: 0.9rem;
}

.task-template-grid .form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.task-template-grid .form-field span {
    font-weight: 600;
    color: #0f172a;
}

.task-template-grid .form-field input,
.task-template-grid .form-field textarea {
    border: 1px solid #d7dce8;
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    font-size: 1rem;
    background: #f8fafc;
}

.form-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-align: center;
    border: 1px solid #fecaca;
}

@media (max-width: 600px) {
    .login-card {
        padding: 1rem 0.6rem;
        margin: 2rem 0 0 0;
        max-width: 98vw;
    }
}

.user-menu-wrap {
    position: relative;
    display: flex;
    align-items: center;
    height: 60px;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.6em;
    cursor: pointer;
    padding: 0.3em 1em 0.3em 0.6em;
    border-radius: 6px;
    transition: background 0.13s;
    user-select: none;
}

.user-menu-toggle:hover,
.user-menu-wrap:focus-within .user-menu-toggle {
    background: #f0f2f5;
}

.user-avatar {
    background: #4f8cff;
    color: #fff;
    width: 2.1em;
    height: 2.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.1em;
    font-weight: 600;
    margin-right: 0.25em;
}

.arrow {
    font-size: 0.6em;
    color: #94a3b8;
    margin-left: 0.4em;
    transition: transform 0.2s;
}
.user-menu-wrap.is-open .arrow {
    transform: rotate(180deg);
}

.user-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 240px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    flex-direction: column;
    padding: 6px 0;
    z-index: 111;
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    color: #343a40;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.12s, color 0.12s;
    border-radius: 0;
}

.user-menu a:hover {
    background: #f8f9fa;
    color: #4c5fd5;
}

.user-menu .logout {
    color: #dc3545;
    border-top: none;
    margin-top: 0;
}

/* --- Multi-compte : comptes liés --- */
.linked-accounts-section {
    padding: 2px 0;
}
.linked-accounts-label {
    padding: 6px 16px 3px;
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.linked-account-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #343a40;
    text-align: left;
    transition: background 0.12s;
}
.linked-account-btn:hover {
    background: #f8f9fa;
}
.linked-account-btn:active {
    background: #e9ecef;
}
.linked-account-avatar {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.7rem !important;
    background: #6c757d !important;
    flex-shrink: 0;
}
.linked-account-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}
.linked-account-name {
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.linked-account-email {
    font-size: 0.73rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.add-account-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    color: #343a40 !important;
    text-decoration: none;
    font-size: 0.85rem;
}
.add-account-link:hover {
    background: #f8f9fa;
    color: #4c5fd5 !important;
}

/* .user-menu-wrap:hover .user-menu,
.user-menu-wrap:focus-within .user-menu {
    display: flex;
} */

/* Burger menu removed — replaced by sidebar toggle */

/* ---- Contacts List & Form ---- */
.contacts-list-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 1.2rem 1.4rem 1.4rem 1.4rem;
    margin-bottom: 2.5rem;
}

.contacts-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.contacts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: none;
}

.contacts-table th,
.contacts-table td {
    padding: 0.38em 0.6em;
    border-bottom: 1px solid #f0f2f5;
    text-align: left;
}

.contacts-table th {
    color: #64748b;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #f7fafd;
}

.contacts-table tr:last-child td {
    border-bottom: none;
}

.btn-table {
    background: #4464c6;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.28em 0.7em;
    font-size: 0.82rem;
    margin-left: 0.2em;
    text-decoration: none;
    transition: background 0.13s;
}

.btn-table:hover {
    background: #3355a5;
}

.btn-table.btn-danger {
    background: #e23d3d;
}

.btn-table.btn-danger:hover {
    background: #a90a21;
}

/* Formulaire contact */
.form-card {
    max-width: 410px;
    margin: 2.5rem auto 0 auto;
    background: #fff;
    border-radius: 13px;
    box-shadow: 0 2px 24px 0 #232a3b10;
    padding: 2rem 2rem 1.5rem 2rem;
}

.form-card h2 {
    text-align: center;
    font-size: 1.17rem;
    margin-bottom: 1.3em;
    color: #232a3b;
}

.contact-form label {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.08em;
    font-size: 1rem;
    color: #232a3b;
    font-weight: 500;
}

.contact-form input {
    margin-top: 0.39em;
    padding: 0.68em 1em;
    border: 1px solid #e0e2ea;
    border-radius: 6px;
    font-size: 1rem;
    background: #f8fafd;
    transition: border 0.18s;
}

.contact-form input:focus {
    outline: none;
    border-color: #4f8cff;
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.12);
    background: #fff;
}

.btn-primary,
.btn-secondary {
    padding: 0.8em 1.6em;
    border-radius: 8px;
    border: none;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.19s, color 0.16s;
}

.btn-primary {
    background: #4f8cff;
    color: #fff;
}

.btn-primary:hover {
    background: #3d7bf7;
}

.btn-secondary {
    background: #f0f3fa;
    color: #232a3b;
    border: 1px solid #ccd2e6;
}

.btn-secondary:hover {
    background: #d4dbef;
}

.form-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-align: center;
    border: 1px solid #fecaca;
}

/* Responsive */
@media (max-width: 900px) {

    .contacts-list-card,
    .form-card {
        padding: 0.7rem 0.4rem 0.8rem 0.4rem;
        border-radius: 8px;
    }

    .form-card {
        max-width: 99vw;
        margin: 1rem 0;
    }

    .contacts-list-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5em;
    }

    .contacts-list-header .btn-primary {
        width: 100%;
        min-width: 0;
        max-width: none;
        box-sizing: border-box;
        margin-bottom: 0.5em;
        align-self: flex-end;
    }

    .btn-secondary {
        width: 100%;
        box-sizing: border-box;
        font-size: 1rem;
    }
}

/* Bouton "Nouveau contact" compact en haut à droite */
.contacts-list-header .btn-primary {
    min-width: 130px;
    max-width: 220px;
    width: auto;
    white-space: nowrap;
    margin-top: 0;
}

/* Correction boutons formulaire contact */
.form-btns .btn-primary {
    width: auto;
    min-width: 120px;
    margin-top: 0;
}

.form-btns .btn-secondary {
    width: auto;
    min-width: 100px;
    margin-top: 0;
    display: inline-block;
    padding: 0.8em 1.6em;
    font-size: 1.07rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-align: center;
    box-sizing: border-box;
}

.form-btns {
    display: flex;
    gap: 0.8em;
    margin-top: 1.2em;
    justify-content: center;
}

@media (max-width: 900px) {
    .form-btns {
        flex-direction: column;
        gap: 0.5em;
    }

    .form-btns .btn-primary,
    .form-btns .btn-secondary {
        width: 100%;
        min-width: 0;
    }
}

/* Profil utilisateur */
.profile-form label {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.08em;
    font-size: 1rem;
    color: #232a3b;
    font-weight: 500;
}

.profile-form input[type="text"],
.profile-form input[type="email"],
.profile-form input[type="password"] {
    margin-top: 0.39em;
    padding: 0.68em 1em;
    border: 1px solid #e0e2ea;
    border-radius: 6px;
    font-size: 1rem;
    background: #f8fafd;
    transition: border 0.18s;
}

.profile-form input:focus {
    outline: none;
    border-color: #4464c6;
    background: #fff;
}

.form-success {
    background: #d4f7e6;
    color: #137942;
    padding: 0.7em 1em;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 1rem;
    text-align: center;
}

/* Correction : chaque champ profil sur une ligne */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.profile-form label {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 1.08em;
    font-size: 1rem;
    color: #232a3b;
    font-weight: 500;
}

.profile-form input {
    width: 100%;
    box-sizing: border-box;
}

/* Tables responsives (contacts, missions, etc.) */
@media (max-width: 700px) {
    .contacts-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background: none;
    }

    .contacts-table thead,
    .contacts-table tbody,
    .contacts-table tr {
        display: table;
        width: 100%;
        min-width: 600px;
        /* largeur minimale pour tout voir sans couper */
    }

    .contacts-table td,
    .contacts-table th {
        white-space: nowrap;
        font-size: 1rem;
        padding: 0.52em 0.5em;
        word-break: break-all;
    }

    .btn-table {
        font-size: 0.95rem;
        padding: 0.33em 0.75em;
    }

    .contacts-list-card {
        padding: 0.3rem 0.1rem 0.6rem 0.1rem;
    }
}


/* Affichage cartes contacts uniquement sur mobile, masque sur desktop */
.contact-cards {
    display: none !important;
}

@media (max-width: 700px) {
    .contacts-table {
        display: none !important;
    }

    .contact-cards {
        display: block !important;
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%;
    }

    .contact-letter-card {
        background: #f3f4f6;
        color: #4b5563;
        font-weight: 700;
        padding: 0.5em 0.75em;
        border-radius: 9px;
        margin: 0.6em 0 0.35em 0;
    }

    .contact-card {
        background: #fff;
        border-radius: 10px;
        border: 1px solid #e7e9f3;
        box-shadow: 0 2px 8px #1f293710;
        padding: 0.9em 0.95em 0.85em 0.95em;
        margin-bottom: 0.75em;
        font-size: 1.02rem;
        display: flex;
        flex-direction: column;
        gap: 0.45em;
    }

    .contact-card-top {
        display: flex;
        justify-content: space-between;
        gap: 0.6em;
        align-items: flex-start;
    }

    .contact-card-name-block {
        flex: 1;
        min-width: 0;
    }

    .contact-card-name {
        font-weight: 700;
        color: #1f2937;
        line-height: 1.2;
    }

    .contact-card-company {
        color: #6b7280;
        font-size: 0.93rem;
        margin-top: 0.1em;
    }

    .contact-card-meta {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4em;
        width: 100%;
    }

    .contact-card-infos {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35em;
        width: 100%;
    }

    .contact-card-phone {
        display: inline-flex;
        align-items: center;
        gap: 0.3em;
        padding: 0.22rem 0.55rem;
        border-radius: 999px;
        background: #eef2ff;
        color: #1f3a8a;
        font-weight: 700;
        font-size: 0.9rem;
    }

    .contact-card-phone i {
        font-size: 0.85rem;
    }

    .contact-card-reminders,
    .contact-card-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35em;
        align-items: center;
    }

    .contact-card-tags {
        width: 100%;
    }

    .contact-cards .contact-reminder-badge {
        font-size: 0.9rem;
        padding: 0.22rem 0.55rem;
    }

    .contact-cards .contact-tag-pill {
        margin: 0;
        padding: 0.24rem 0.55rem;
        font-size: 0.9rem;
    }

    .contact-actions {
        gap: 0.45em;
        margin-top: 0;
    }

    .contact-actions.contact-actions-icons {
        flex-shrink: 0;
    }

    .contact-actions .contact-action-icon {
        margin-left: 0;
    }
}

@media (max-width: 700px) {
    .contacts-list-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8em;
    }

    .contacts-list-header .btn-primary {
        margin: 0 auto;
        display: block;
        width: 90%;
        min-width: 120px;
        max-width: 230px;
        font-size: 1.04rem;
        padding: 0.6em 0;
        box-sizing: border-box;
        text-align: center;
    }
}

/* ----- Models List Cards (mobile) ----- */
.model-cards {
    display: none;
}

@media (max-width: 700px) {
    .models-table {
        display: none;
    }

    .model-cards {
        display: block;
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%;
    }

    .model-card {
        background: #fff;
        border-radius: 9px;
        box-shadow: 0 2px 10px #232a3b11;
        padding: 1.1em 1.1em 0.7em 1.1em;
        margin-bottom: 1.2em;
        font-size: 1.09rem;
        display: flex;
        flex-direction: column;
        gap: 0.7em;
    }

    .model-info>div {
        margin-bottom: 0.11em;
        word-break: break-all;
    }

    .model-actions {
        display: flex;
        gap: 0.6em;
        justify-content: flex-end;
        margin-top: 0.6em;
    }

    .model-card .btn-table {
        width: auto;
        min-width: 0;
        font-size: 1rem;
        padding: 0.38em 1.1em;
        border-radius: 6px;
    }
}

/* --- Models List (desktop) --- */
.models-list-card {
    background: #fff;
    border-radius: 13px;
    box-shadow: 0 4px 24px 0 #232a3b10;
    padding: 1.4rem 1.7rem 2.2rem 1.7rem;
    margin: 2.4rem auto 2.5rem auto;
    max-width: 830px;
    min-width: 320px;
}

.models-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.4em;
    gap: 1em;
}

.models-list-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.btn-new-model {
    min-width: 150px;
    max-width: 230px;
    width: 210px;
    font-size: 1.07rem;
    padding: 0.56em 0;
    text-align: center;
    display: inline-block;
}

.models-table {
    width: 100%;
    margin-top: 0;
    background: #f7fafd;
    border-radius: 8px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: 0 1px 8px #232a3b10;
}

.models-table th,
.models-table td {
    padding: 0.7em 1em;
    border-bottom: 1px solid #e5e7f0;
    text-align: left;
    font-size: 1rem;
}

.models-table th {
    color: #232a3b;
    font-weight: 700;
    background: #f1f4f8;
}

.models-table tr:last-child td {
    border-bottom: none;
}

@media (max-width: 700px) {
    .models-list-card {
        padding: 0.8rem 0.3rem 1.1rem 0.3rem;
        border-radius: 8px;
        max-width: 99vw;
        margin: 1rem 0;
    }

    .models-list-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8em;
    }

    .btn-new-model {
        margin: 0 auto;
        display: block;
        width: 90%;
        min-width: 120px;
        max-width: 230px;
        font-size: 1.04rem;
        padding: 0.6em 0;
        box-sizing: border-box;
        text-align: center;
    }
}


.model-form-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 28px #232a3b18;
    padding: 1.7rem 2rem 2.1rem 2rem;
    margin: 2.5rem auto 2.5rem auto;
    max-width: 100%;
    min-width: 320px;
    width: 100%;
    /* Limite la largeur sur grand écran */
    max-width: 800px;
}


.model-form-title {
    font-size: 1.32rem;
    margin-bottom: 1.2em;
    font-weight: bold;
    text-align: center;
}

.form-label {
    font-weight: 600;
    color: #232a3b;
    margin-bottom: 0.5em;
    display: block;
}

.form-input {
    width: 100%;
    border-radius: 7px;
    border: 1px solid #c8d0df;
    padding: 0.65em 1em;
    font-size: 1.08rem;
    background: #f6f8fd;
    margin-top: 0.5em;
}

.form-error {
    background: #ffdbe2;
    color: #be0c2a;
    border-radius: 6px;
    padding: 0.5em 1em;
    margin-bottom: 1em;
    text-align: center;
}

/* ---- FIELDS LIST (champs dynamiques du formulaire modèle) ---- */
#fields-list li {
    gap: 8px;
    margin: 6px 0;
    padding: 6px 8px;
    min-height: 36px;
    border-radius: 7px;
    border: 1px solid #e0e6ef;
    background: #f7fafd;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 7px #232a3b09;
    transition: box-shadow 0.18s, border 0.18s;
    width: 100%;
    max-width: 100%;
}

#fields-list li:focus-within {
    border: 1.5px solid #4464c6;
    box-shadow: 0 4px 13px #4464c62a;
}

#fields-list input[type="text"] {
    flex: 2 1 130px;
    max-width: 160px;
    border-radius: 5px;
    border: 1px solid #ccd1de;
    padding: 4px 8px;
    background: #fff;
    font-size: 0.9rem;
    height: 28px;
}

#fields-list select {
    flex: 1 1 90px;
    max-width: 180px;
    padding: 4px 8px;
    border-radius: 5px;
    border: 1px solid #ccd1de;
    background: #fff;
    font-size: 0.9rem;
    height: 28px;
}

#fields-list .field-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    margin-left: auto;
}

#fields-list button {
    border: none;
    background: none;
    font-size: 1.25em;
    color: #8795ad;
    cursor: pointer;
    transition: color 0.16s, background 0.14s;
    padding: 5px;
    border-radius: 4px;
}

#fields-list button:hover {
    color: #4464c6;
    background: #eef3fb;
}

@media (max-width: 600px) {
    #fields-list li {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        margin: 5px 0;
        padding: 5px 6px;
        min-height: auto;
    }

    #fields-list input[type="text"],
    #fields-list select {
        width: 100%;
        max-width: 100%;
        padding: 6px 10px;
        font-size: 1rem;
        height: auto;
    }

    #fields-list .field-actions {
        margin-left: 0;
        justify-content: flex-end;
        gap: 10px;
        width: 100%;
    }
}

.btn-primary {
    background: #4464c6;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 1.11rem;
    padding: 0.55em 1.4em;
    margin-right: 0.8em;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.16s;
}

.btn-primary:hover {
    background: #2941a5;
}

.btn-secondary {
    background: #f7fafd;
    color: #2941a5;
    border: 1px solid #c8d0df;
    border-radius: 7px;
    font-size: 1.05rem;
    padding: 0.55em 1.2em;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.16s, border 0.16s;
}

.btn-secondary:hover {
    background: #e9f0fc;
    border-color: #9eb5dd;
}

/* --- PATCH formulaire modèle & boutons alignés --- */
.form-actions {
    display: flex;
    gap: 1em;
    margin-top: 2.2em;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.form-actions button,
.form-actions a.btn-secondary {
    height: 44px;
    min-width: 130px;
    line-height: 44px;
    display: inline-block;
    vertical-align: middle;
    padding: 0 1.3em;
    box-sizing: border-box;
    font-size: 1.09rem;
}

.btn-secondary {
    height: 44px;
    min-width: 110px;
    padding: 0 1.1em;
    display: inline-block;
    vertical-align: middle;
    text-align: center;
}

/* Padding formulaire modèle sur mobile extra-small */
@media (max-width: 400px) {
    .model-form-card {
        padding: 0.3rem 0.07rem 0.8rem 0.07rem;
    }
}


/* Largeur max du champ nom du modèle */
.model-form-card input[type="text"].form-input {
    max-width: 300px;
    width: 100%;
}

@media (max-width: 600px) {
    .model-form-card {
        padding: 0.7rem 0.3rem 1.3rem 0.3rem;
        max-width: 99vw;
    }

    #fields-list li {
        flex-direction: column;
        align-items: stretch;
    }

    .model-form-card input[type="text"].form-input {
        max-width: 100%;
    }

    #fields-list .field-actions {
        margin-left: 0;
        justify-content: flex-end;
        gap: 17px;
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.6em;
        align-items: stretch;
    }
}

/* ----- Alignement colonne Actions ----- */
.actions-column {
    width: auto !important;
    max-width: none !important;
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}

.actions-column .btn-table {
    margin-left: 0.3em;
    margin-right: 0;
    white-space: nowrap;
    vertical-align: middle;
}

/* Prevent shrinking and align column 3 to the right in models-table */
.models-table td:nth-child(3) {
    white-space: nowrap;
    text-align: right;
}

/* Limit width and center text for "Nombre de champs" column (2nd) in models-table */
.models-table td:nth-child(2) {
    max-width: 60px;
    text-align: center;
}

/* --- Models list desktop (table) --- */
.models-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 8px #232a3b10;
    background: #f7fafd;
}

.models-table th,
.models-table td {
    padding: 0.7em 1em;
    border-bottom: 1px solid #e5e7f0;
    text-align: left;
    font-size: 1rem;
}

.models-table th {
    background: #f1f4f8;
    color: #232a3b;
    font-weight: 700;
}

.models-table tr:last-child td {
    border-bottom: none;
}

.actions-column {
    width: 140px;
    max-width: 140px;
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}

.actions-column .btn-table {
    margin-left: 0.3em;
    white-space: nowrap;
    vertical-align: middle;
}

/* --- Models list mobile (cards) --- */
.model-cards {
    display: none;
}

@media (max-width: 700px) {
    .models-table {
        display: none;
    }

    .model-cards {
        display: block;
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%;
    }

    .model-card {
        background: #fff;
        border-radius: 9px;
        box-shadow: 0 2px 10px #232a3b11;
        padding: 1.1em 1.1em 0.7em 1.1em;
        margin-bottom: 1.2em;
        font-size: 1.09rem;
        display: flex;
        flex-direction: column;
        gap: 0.7em;
    }

    .model-info>div {
        margin-bottom: 0.11em;
        word-break: break-word;
    }

    .model-actions {
        display: flex;
        gap: 0.6em;
        justify-content: flex-end;
        margin-top: 0.6em;
    }

    .model-card .btn-table {
        width: auto;
        min-width: 0;
        font-size: 1rem;
        padding: 0.38em 1.1em;
        border-radius: 6px;
    }
}

.contact-search-input {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #c8d0df;
    padding: 0.4em 0.8em;
    min-width: 200px;
    max-width: 320px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .contact-search-input {
        margin: 1em 0 0.5em 0;
        width: 100%;
        max-width: 100%;
    }
}

/* ----- Champs dynamiques modèle ----- */
.field-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 6px 0;
    padding: 6px 8px;
    padding-right: 8px;
    border-radius: 7px;
    border: 1px solid #e0e6ef;
    background: #f7fafd;
    box-shadow: 0 2px 7px #232a3b09;
    transition: box-shadow 0.18s, border 0.18s;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
}

.field-row:focus-within {
    border: 1.5px solid #4464c6;
    box-shadow: 0 4px 13px #4464c62a;
}

.field-main-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
    flex: 1;
}

.field-label {
    flex: 2 1 220px;
    max-width: 100%;
    border-radius: 5px;
    border: 1px solid #ccd1de;
    padding: 6px 10px;
    background: #fff;
    font-size: 1rem;
    height: 32px;
    box-sizing: border-box;
    width: 100%;
}

.field-type {
    flex: 1 1 220px;
    max-width: 220px;
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid #ccd1de;
    background: #fff;
    font-size: 1rem;
    height: 32px;
    box-sizing: border-box;
    width: 100%;
}

.field-options {
    flex: 1 1 100%;
    max-width: 100%;
    min-height: 48px;
    border-radius: 5px;
    border: 1px solid #ccd1de;
    padding: 6px 10px;
    background: #fff;
    font-size: 0.95rem;
    resize: vertical;
    margin-top: 6px;
    box-sizing: border-box;
    width: 100%;
}

.field-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.field-actions button {
    border: none;
    background: none;
    font-size: 1.3em;
    color: #8795ad;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.field-actions button:hover {
    color: #4464c6;
    background: #eef3fb;
}

/* Responsive */
@media (max-width: 600px) {
    .field-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin: 8px 0;
        padding: 8px 10px;
        padding-right: 10px;
        min-height: auto;
    }

    .field-main-row {
        flex-direction: column;
        gap: 6px;
        align-items: stretch;
    }

    .field-label,
    .field-type {
        flex: 1 1 100%;
        max-width: 100%;
        height: 36px;
        font-size: 1rem;
        padding: 0.5em 0.8em;
    }

    .field-options {
        min-height: 64px;
        font-size: 1rem;
        padding: 0.6em 0.8em;
        margin-top: 4px;
    }

    .field-actions {
        margin-left: 0;
        justify-content: flex-end;
    }
}

/* Correction centrage formulaire modèle sur mobile */
.model-form-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Centrage global */
    padding: 2rem;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
}

.model-form-card form {
    width: 100%;
    /* Toute la largeur disponible */
    max-width: 100%;
}

.form-label,
.form-label-fields {
    display: block;
    text-align: left;
    /* Alignement texte à gauche pour la lisibilité */
    width: 100%;
    /* Même largeur pour tous les labels */
    margin-bottom: 0.5rem;
    box-sizing: border-box;
}

.form-input {
    width: 100%;
    max-width: 100%;
}

.mission-model-select {
    width: auto;
    min-width: 0;
}


#fields-list {
    width: 100%;
    padding-left: 0;
    margin-left: 0;
    box-sizing: border-box;
}

.field-row {
    width: 100%;
    /* Utilise toute la largeur du conteneur parent */
    box-sizing: border-box;
}

.fields-add-btn-row,
.form-actions {
    width: 100%;
    text-align: center;
}

.field-actions {
    margin-left: auto;
}

/* --- Mission list (desktop) --- */
.missions-list-card {
    background: #fff;
    border-radius: 13px;
    box-shadow: 0 4px 24px 0 #232a3b10;
    padding: 1.4rem 1.7rem 2.2rem 1.7rem;
    margin: 2.4rem auto 2.5rem auto;
    max-width: 830px;
    min-width: 320px;
}

.missions-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.4em;
    gap: 1em;
}

.missions-list-header h2 {
    font-size: 1.25rem;
    margin: 0;
}

.btn-new-mission {
    min-width: 150px;
    max-width: 230px;
    width: 210px;
    font-size: 1.07rem;
    padding: 0.56em 0;
    text-align: center;
    display: inline-block;
}

/* Table */
.missions-table {
    width: 100%;
    margin-top: 0;
    background: #f7fafd;
    border-radius: 8px;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: 0 1px 8px #232a3b10;
}

.missions-table th,
.missions-table td {
    padding: 0.7em 1em;
    border-bottom: 1px solid #e5e7f0;
    text-align: left;
    font-size: 1rem;
}

.missions-table th {
    color: #232a3b;
    font-weight: 700;
    background: #f1f4f8;
}

.missions-table tr:last-child td {
    border-bottom: none;
}

/* Actions colonne */
.missions-table .actions-column {
    width: 180px;
    max-width: 180px;
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}

.missions-table .btn-table {
    margin-left: 0.3em;
    white-space: nowrap;
    vertical-align: middle;
}

/* --- Mission list mobile (cards) --- */
.mission-cards {
    display: block;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.mission-card {
    background: #fff;
    border-radius: 13px;
    box-shadow: 0 4px 18px 0 #232a3b18;
    padding: 1.3em 1.3em 1em 1.3em;
    margin-bottom: 1.5em;
    font-size: 1.09rem;
    display: flex;
    flex-direction: column;
    gap: 0.7em;
    border: 1px solid #e5e7f0;
    transition: box-shadow 0.18s;
}

.mission-card:hover {
    box-shadow: 0 6px 22px #4464c62b;
}

.mission-card--finalized {
    background: #f7f8fc;
    border-color: #e2e8f0;
    box-shadow: none;
}

.mission-card--finalized strong {
    color: #475569;
}

.mission-card--finalized .mission-task-dates,
.mission-card--finalized .mission-task-date-item {
    color: #94a3b8 !important;
}

.date-limit-orange {
    color: #fa7d09;
    font-weight: 600;
}

.date-limit-red {
    color: #d32d2d;
    font-weight: 700;
}

.task-finalized-pill {
    background: #e2e8f0;
    color: #0f172a;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.1rem 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.drag-handle--finalized {
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.drag-handle--finalized i {
    font-size: 0.65rem;
    line-height: 16px;
    color: #16a34a;
}

.task-finalize-toggle {
    color: #94a3b8 !important;
    font-size: 1.1em;
}

.task-finalize-toggle.is-active {
    color: #16a34a !important;
}

.task-assigned-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #eef2ff;
    color: #2563eb;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.task-assigned-icon i {
    line-height: 1;
}

.task-finalize-toggle:hover {
    color: #0f172a !important;
}

.mission-info>div {
    margin-bottom: 0.11em;
    word-break: break-word;
}

/* .mission-actions {
    display: flex;
    gap: 0.6em;
    justify-content: flex-end;
    margin-top: 0.6em;
} */
.mission-card .btn-table {
    width: auto;
    min-width: 0;
    font-size: 1rem;
    padding: 0.38em 1.1em;
    border-radius: 6px;
}

.mission-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1em;
}

.mission-actions-icons {
    display: flex;
    gap: 0.65em;
}

.mission-actions-icons a {
    color: #8795ad;
    background: none;
    border-radius: 5px;
    padding: 0.22em 0.29em;
    font-size: 1.19em;
    transition: color 0.16s;
}

.mission-actions-icons a:hover {
    color: #4464c6;
    background: none;
}

.mission-date {
    margin-top: 1.2em;
    font-size: 0.8em;
    color: #a4a8b6;
    text-align: right;
    font-weight: 400;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.22em;
    margin-bottom: 1.4em;
}

.form-group label {
    font-weight: 600;
    color: #232a3b;
    margin-bottom: 0.3em;
    font-size: 1.06rem;
    letter-spacing: 0.02em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    border-radius: 7px;
    border: 1.5px solid #c8d0df;
    padding: 0.62em 1em;
    font-size: 1.09rem;
    background: #f6f8fd;
    margin-top: 0.2em;
    transition: border 0.2s;
    box-sizing: border-box;
}

.date-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    flex-wrap: wrap;
}

.date-input-wrapper .mission-input {
    flex: 1;
    min-width: 190px;
}

.date-clear-btn {
    border: 1px solid #d2d9ea;
    background: #f6f8fd;
    color: #1f2937;
    border-radius: 999px;
    font-size: 0.82rem;
    padding: 0.35rem 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
    white-space: nowrap;
    flex: 0 0 auto;
}

.date-clear-btn:hover {
    background: #eef2ff;
    color: #0f172a;
    border-color: #c0c9ef;
}

.date-clear-btn:focus-visible {
    outline: 2px solid #4464c6;
    outline-offset: 2px;
}

.mission-due-datetime {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.8rem;
}

.mission-due-date-field {
    flex: 1;
    min-width: 240px;
}

.mission-time-selects {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.mission-time-select {
    width: 82px;
}

.mission-time-separator {
    font-weight: 700;
    color: #1f2937;
}

@media (max-width: 720px) {
    .mission-due-datetime {
        flex-direction: column;
        align-items: stretch;
    }

    .mission-time-selects {
        width: 100%;
        justify-content: flex-start;
    }

    .mission-time-select {
        flex: 1;
        min-width: 0;
    }

    .date-input-wrapper .mission-input {
        min-width: 0;
    }
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group textarea:focus {
    border-color: #4464c6;
    background: #fff;
    outline: none;
}

.richtext-wrapper,
.richtext-wrapper .ql-toolbar.ql-snow,
.richtext-wrapper .ql-container.ql-snow,
.richtext-wrapper .ql-editor {
    background: #fff;
}

.kit-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.kit-hero {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.kit-helper {
    color: #4b5563;
    font-size: 0.95rem;
}

.kit-helper a {
    color: #2941a5;
    text-decoration: underline;
}

.kit-hero-search {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 1.6rem;
}

.kit-search-input {
    border: 1.5px solid #dbe2f5;
    border-radius: 999px;
    padding: 0.55rem 1rem;
    min-width: 320px;
    width: 100%;
    max-width: 420px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.kit-search-input:focus {
    outline: none;
    border-color: #4c63d3;
    box-shadow: 0 0 0 3px rgba(76, 99, 211, 0.15);
}

.kit-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.kit-card {
    border: 1px solid #e0e7ff;
    border-radius: 14px;
    padding: 1.1rem;
    background: #fff;
    box-shadow: 0 12px 35px rgba(14, 28, 75, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.kit-card--inactive {
    background: #f6f9ff;
    opacity: 0.85;
}

.kit-card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
}

.kit-card-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.kit-card-actions a {
    color: #1d3aa1;
}

.kit-delete-btn {
    border: none;
    background: transparent;
    color: #c9405c;
    cursor: pointer;
}

.kit-audience {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.kit-description {
    color: #475569;
    min-height: 40px;
    margin-top: -0.2rem;
}

.kit-stats {
    display: flex;
    gap: 1rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.kit-stats li {
    flex: 1;
    background: #f5f7ff;
    border-radius: 10px;
    padding: 0.6rem;
    text-align: center;
}

.kit-stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: #1d3aa1;
}

.kit-preview {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    border: 1px solid #edf0ff;
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    background: #f9faff;
}

.kit-preview-group {
    flex: 1 1 160px;
    min-width: 180px;
}

.kit-preview-group strong {
    display: block;
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 0.3rem;
}

.kit-preview-group ul {
    list-style: disc;
    margin: 0;
    padding-left: 1.1rem;
    color: #475569;
    font-size: 0.92rem;
}

.kit-preview-group li {
    margin-bottom: 0.15rem;
}

.kit-preview-more {
    color: #1d3aa1;
    font-weight: 600;
}

.kit-preview-empty {
    margin: 0;
    color: #94a3b8;
    font-size: 0.9rem;
    font-style: italic;
}

.kit-import-form {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.kit-import-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
}

.kit-import-options label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.95rem;
    color: #334155;
}

.kit-muted-hint {
    color: #94a3b8;
    font-size: 0.9rem;
}

.kit-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #1d3aa1;
    color: #fff;
}

.kit-badge--muted {
    background: #cbd5f5;
    color: #35405f;
}

.kit-form-page {
    max-width: 960px;
    margin: 0 auto;
}

.kit-form-head {
    margin-bottom: 1.5rem;
}

.kit-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 18px 40px rgba(33, 56, 108, 0.08);
}

.kit-form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.kit-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 600;
    color: #1f2937;
}

.kit-form .form-field span {
    font-size: 0.95rem;
    color: #334155;
}

.kit-form .form-field input,
.kit-form .form-field textarea {
    border: 1.5px solid #dbe2f5;
    border-radius: 12px;
    padding: 0.65rem 0.9rem;
    background: #f8f9ff;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.kit-form .form-field textarea {
    resize: vertical;
}

.kit-form .form-field input:focus,
.kit-form .form-field textarea:focus {
    outline: none;
    border-color: #4c63d3;
    box-shadow: 0 0 0 3px rgba(76, 99, 211, 0.15);
    background: #fff;
}

.kit-form .form-field input::placeholder,
.kit-form .form-field textarea::placeholder {
    color: #94a3b8;
}

.kit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    margin: 1rem 0;
}

.kit-toggle input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #4c63d3;
}

.kit-assets {
    margin-bottom: 1.2rem;
}

.kit-assets header {
    margin-bottom: 0.4rem;
}

.kit-check-grid {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.9rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.6rem;
    max-height: 260px;
    overflow-y: auto;
}

.kit-check-grid label {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    color: #1f2937;
    font-size: 0.94rem;
}

.kit-empty {
    color: #94a3b8;
    font-style: italic;
}

.kit-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 1.4rem;
}

.kit-cta {
    margin-top: 2.5rem;
    padding: 1.5rem;
    border: 1px solid #dfe3f5;
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #eef2ff, #f8f9ff);
    box-shadow: 0 18px 40px rgba(19, 35, 80, 0.08);
}

.kit-cta-content h2 {
    margin: 0.2rem 0;
}

.kit-cta .btn-primary {
    white-space: nowrap;
    width: auto;
}

@media (max-width: 640px) {
    .kit-cta {
        flex-direction: column;
        align-items: flex-start;
    }

    .kit-cta .btn-primary {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

.task-activity-headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.task-geo-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: #f1f5f9;
    border: 1px solid #d9e3f6;
    border-radius: 999px;
    padding: 0.3rem 0.8rem 0.3rem 1rem;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.task-geo-toggle.is-on {
    background: #e0ecff;
    border-color: #94b7ff;
}

.task-geo-toggle-label {
    font-size: 0.92rem;
}

.task-geo-toggle-switch {
    width: 38px;
    height: 20px;
    border-radius: 999px;
    background: #cbd5f5;
    position: relative;
}

.task-geo-toggle.is-on .task-geo-toggle-switch {
    background: #2563eb;
}

.task-geo-toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
}

.task-geo-toggle.is-on .task-geo-toggle-switch::after {
    transform: translateX(18px);
}

.task-activity-geo {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-top: 0.8rem;
    color: #0f172a;
}

.task-activity-geo i {
    color: #2563eb;
    margin-top: 0.25rem;
}

.task-activity-geo-coords {
    font-size: 0.88rem;
    color: #475569;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    align-items: center;
}

.task-activity-geo-focus {
    border: none;
    background: none;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.task-activity-geo-focus:hover {
    text-decoration: underline;
}

.task-activity-empty-text {
    font-style: italic;
    color: #94a3b8;
}

.task-geo-marker-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
    transition: box-shadow 0.2s;
}

.task-geo-marker-badge.is-focused {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.95), 0 0 0 8px rgba(37, 99, 235, 0.55), 0 6px 18px rgba(15, 23, 42, 0.5);
    animation: geo-marker-focus 0.65s ease-in-out 3;
}

@keyframes geo-marker-focus {
    0%   { transform: scale(1);    }
    50%  { transform: scale(1.55); }
    100% { transform: scale(1);    }
}

.task-activity-item.is-highlighted {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.task-activity-map-block {
    margin-top: 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.25rem;
    background: #fff;
    box-shadow: 0 18px 40px rgba(19, 35, 80, 0.07);
}

.task-activity-map-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.task-gps-legal {
    font-size: 0.9rem;
    color: #475569;
    margin: 0.2rem 0 0;
}

.task-activity-map-refresh {
    border: none;
    background: #eef2ff;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    color: #1d4ed8;
    cursor: pointer;
}

.task-activity-map-wrapper {
    margin-top: 1rem;
}

.task-activity-map-empty {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #475569;
}

.task-activity-map {
    width: 100%;
    height: 320px;
    margin-top: 0.8rem;
    border-radius: 14px;
    overflow: hidden;
    display: none;
}

.task-activity-map-block[data-has-points="1"] .task-activity-map {
    display: block;
}

.task-activity-map-block[data-has-points="1"] .task-activity-map-empty {
    display: none;
}

.filature-launcher {
    position: fixed;
    right: 20px;
    bottom: 90px;
    border: none;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    width: 50px;
    height: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filature-launcher:hover {
    transform: scale(1.1);
    background: #1e293b;
}

.filature-launcher i {
    font-size: 1.2rem;
}

.filature-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 400;
}

.filature-modal.is-open {
    display: flex;
}

.filature-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
}

.filature-modal-card {
    position: relative;
    background: #fff;
    border-radius: 24px;
    padding: 2rem;
    width: min(480px, 90vw);
    box-shadow: 0 40px 80px rgba(15, 23, 42, 0.35);
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filature-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: none;
    font-size: 1.4rem;
    color: #475569;
    cursor: pointer;
}

.filature-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0;
}

.filature-modal-card h3 {
    margin: 0;
    font-size: 1.45rem;
    color: #0f172a;
}

.filature-sub {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
}

.filature-status-group {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    flex-wrap: wrap;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.8rem 1rem;
    background: #f8fafc;
}

.filature-status-group span {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}

.filature-status-group strong {
    display: block;
    color: #0f172a;
    font-size: 1rem;
}

#filature-record-btn {
    display: none;
}

#filature-note-input {
    border: 1px solid #dbe2f5;
    border-radius: 14px;
    min-height: 90px;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
}

.filature-actions {
    display: flex;
    justify-content: flex-end;
}

#filature-save-btn {
    min-width: 200px;
}

.filature-save-ready {
    background: #16a34a;
    color: #fff;
    border: none;
}

.filature-feedback {
    min-height: 1.2rem;
    font-size: 0.9rem;
    color: #dc2626;
    margin: 0;
}

body.filature-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .filature-launcher {
        right: 15px;
        bottom: 136px;
        width: 46px;
        height: 46px;
    }

    .filature-modal-card {
        width: min(560px, 94vw);
        padding: 1.5rem 1.3rem;
        border-radius: 20px;
    }
}

/* Mise en forme description mission (HTML issu de l'editeur riche) */
.mission-description {
    background: #f8fafd;
    border-radius: 8px;
    padding: 1.1em 1.4em;
    margin-bottom: 1.8em;
    margin-top: 0.9em;
    font-size: 1.08rem;
    color: #222;
    line-height: 1.7;
    word-break: break-word;
}

.mission-description h1,
.mission-description h2,
.mission-description h3 {
    color: #2941a5;
    margin-top: 1.2em;
    margin-bottom: 0.7em;
    font-weight: bold;
}

.mission-description p {
    margin: 0 0 0.8em 0;
}

.mission-description ul,
.mission-description ol {
    margin-left: 1.4em;
    margin-bottom: 1em;
}

.mission-description a {
    color: #295bc3;
    text-decoration: underline;
}

.mission-description strong {
    font-weight: bold;
}

.mission-description em {
    font-style: italic;
}

.billing-wrapper {
    max-width: 1100px;
    margin: 0 auto 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.billing-current-card,
.billing-plans,
.billing-admin-section {
    background: #fff;
    border-radius: 18px;
    padding: 1.6rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.billing-current-plan {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.billing-status-pill {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    background: #e2e8f0;
    text-transform: capitalize;
}

.billing-status-pill.billing-status-active {
    background: #dcfce7;
    color: #166534;
}

.billing-status-pill.billing-status-free {
    background: #dbeafe;
    color: #1d4ed8;
}

.billing-usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.billing-usage-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.9rem;
}

.billing-usage-item.is-warning {
    background: #fff7ed;
    border: 1px solid #f97316;
}

.billing-usage-item.is-danger {
    background: #fee2e2;
    border: 1px solid #dc2626;
}

.billing-usage-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.billing-progress {
    background: #e2e8f0;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.billing-progress-bar {
    background: #6366f1;
    height: 100%;
    border-radius: 999px;
}

.billing-progress-bar.is-warning {
    background: #f97316;
}

.billing-progress-bar.is-danger {
    background: #dc2626;
}

.billing-upgrade-call {
    margin-top: 1rem;
}

.billing-upgrade-call.billing-upgrade-critical {
    border: 1px solid #dc2626;
    background: #fee2e2;
    color: #991b1b;
}

.billing-upgrade-call.billing-upgrade-warning {
    border: 1px solid #f97316;
    background: #fff7ed;
    color: #92400e;
}

.billing-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.2rem;
    margin-top: 1rem;
}

.billing-plan-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    background: #fff;
}

.billing-plan-card.is-current {
    border-color: #6366f1;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.billing-price-block {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.billing-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.billing-price.secondary {
    font-size: 1.2rem;
    color: #475569;
}

.billing-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.billing-features li {
    padding: 0.2rem 0;
}

.billing-current-label {
    font-weight: 600;
    color: #16a34a;
}

.billing-form {
    margin: 0;
}

.billing-form button {
    width: 100%;
}

.billing-admin-wrapper {
    max-width: 1200px;
    margin: 0 auto 2rem;
}

.billing-admin-section {
    margin-bottom: 2rem;
}

.billing-admin-table {
    width: 100%;
    border-collapse: collapse;
}

.billing-admin-table th,
.billing-admin-table td {
    padding: 0.6rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.billing-admin-table input,
.billing-admin-table select,
.billing-inline-form input,
.billing-inline-form select {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #cbd5f5;
    font-size: 0.9rem;
}

.billing-actions {
    margin-top: 1rem;
}

.billing-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #e2e8f0;
    border-radius: 999px;
    font-size: 0.85rem;
}

.billing-badge.secondary {
    background: #fee2e2;
    color: #991b1b;
}

.billing-inline-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.billing-note {
    font-size: 0.85rem;
    color: #475569;
}

.billing-form-actions {
    margin-top: 0.8rem;
    text-align: right;
}

.billing-success {
    max-width: 540px;
    margin: 2rem auto;
    text-align: center;
    background: #fff;
    padding: 2rem;
    border-radius: 18px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.1);
}

.mail-log-table .mail-log-debug {
    max-height: 160px;
    overflow: auto;
    background: #0f172a;
    color: #f8fafc;
    padding: 0.6rem;
    border-radius: 12px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.85rem;
}

.mail-log-table {
    table-layout: fixed;
    width: 100%;
}

.mail-log-table th,
.mail-log-table td {
    word-break: break-word;
    vertical-align: top;
}

.mail-log-text {
    white-space: pre-wrap;
}

.mail-log-table tr.mail-log-error {
    background: #fef2f2;
}

.mail-log-table tr.mail-log-success {
    background: #f0fdf4;
}

.mail-log-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}

.mail-log-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.9rem;
    color: #fff;
}

.mail-log-pill--ok {
    background: #16a34a;
}

.mail-log-pill--ko {
    background: #ef4444;
}

.mail-log-debug-row {
    display: none;
}

.mail-log-error-text {
    color: #b91c1c;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.mail-log-debug-toggle {
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid #94a3b8;
    background: #fff;
    font-size: 0.85rem;
    cursor: pointer;
}

.dictionary-page {
    max-width: 1200px;
    margin: 0 auto 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dictionary-create-card,
.dictionary-table-card {
    background: #fff;
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.08);
}

.dictionary-create-header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.6rem;
    align-items: flex-start;
}

.dictionary-create-header .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 0.2rem;
}

.dictionary-create-header h2 {
    margin: 0;
    font-size: 1.85rem;
    color: #0f172a;
}

.dictionary-create-header .eyebrow+h2 {
    margin-top: 0.6rem;
}

.dictionary-create-header .subtitle {
    margin: 0.2rem 0 0;
    color: #475569;
    max-width: 640px;
}

.dictionary-create-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.dictionary-create-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem 1.5rem;
}

.dictionary-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    color: #0f172a;
    font-weight: 500;
}

.dictionary-field em {
    font-style: normal;
    font-size: 0.85rem;
    color: #94a3b8;
}

.dictionary-field input,
.dictionary-field textarea {
    border: 1px solid #dbe2f2;
    border-radius: 10px;
    font-size: 1rem;
    padding: 0.85rem 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.dictionary-field textarea {
    resize: vertical;
    min-height: 140px;
}

.dictionary-field input:focus,
.dictionary-field textarea:focus {
    outline: none;
    border-color: #4464c6;
    box-shadow: 0 0 0 2px rgba(68, 100, 198, 0.15);
}

.dictionary-shortcut-input {
    display: flex;
    border: 1px solid #dbe2f2;
    border-radius: 10px;
    background: #f8f9ff;
    padding: 0 0.6rem;
    align-items: center;
    gap: 0.4rem;
}

.dictionary-shortcut-input span {
    color: #475569;
    font-weight: 700;
    font-size: 1.05rem;
}

.dictionary-shortcut-input input {
    border: none;
    background: transparent;
    padding: 0.85rem 0.4rem;
    flex: 1;
    font-size: 1rem;
}

.dictionary-shortcut-input input:focus {
    outline: none;
}

.dictionary-shortcut-input--large input {
    font-size: 1.1rem;
}

.dictionary-field--full {
    width: 100%;
}

.dictionary-form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-large {
    padding: 0.95rem 1.8rem;
    font-size: 1rem;
}

.btn-secondary--ghost {
    border: 1px solid #dbe3f6;
    color: #1f2a44;
    background: transparent;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
}

.btn-secondary--ghost:hover {
    background: #f5f7ff;
}

.dictionary-table-card {
    padding-top: 1.6rem;
}

.dictionary-table-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #0f172a;
}

.dictionary-table-header p {
    margin: 0.3rem 0 0;
    color: #64748b;
}

.btn-compact {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
}

.dictionary-empty-card {
    margin: 1rem 0 0;
    padding: 1rem 1.2rem;
    border-radius: 10px;
    background: #f8f9ff;
    color: #64748b;
}

.dictionary-hidden-forms {
    display: none;
}

.dictionary-card-list {
    list-style: none;
    padding: 0;
    margin: 1.4rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dictionary-entry-card {
    border: 1px solid #e3e8f5;
    border-radius: 16px;
    padding: 1.1rem 1.2rem;
    background: #fdfdff;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dictionary-entry-card-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.dictionary-entry-card-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.card-shortcut {
    font-weight: 700;
    color: #1d4ed8;
    font-size: 1.05rem;
}

.card-label {
    color: #475569;
    font-size: 0.95rem;
    background: #eef2ff;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}

.card-tag {
    font-size: 0.78rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dictionary-entry-card-body {
    margin-top: 0.75rem;
}

.card-preview {
    margin: 0;
    color: #1e293b;
    font-size: 0.95rem;
}

.card-full-text {
    margin-top: 0.75rem;
    border-left: 3px solid #dbe2f2;
    padding-left: 0.9rem;
    color: #334155;
    display: none;
}

.dictionary-entry-card.is-expanded .card-full-text {
    display: block;
}

.dictionary-entry-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.9rem;
    align-items: center;
}

.dictionary-icon-btn {
    border: none;
    background: #eef2ff;
    color: #1d4ed8;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.dictionary-icon-btn:hover {
    background: #dbe2ff;
}

.dictionary-icon-btn.danger {
    background: #ffe4e6;
    color: #dc2626;
}

.dictionary-icon-btn.danger:hover {
    background: #fecdd3;
}

.dictionary-delete-form {
    margin: 0;
}

.dictionary-entry-edit-form {
    display: none;
    margin-top: 1rem;
    border-top: 1px solid #e3e8f5;
    padding-top: 1rem;
}

.dictionary-entry-card.is-editing .dictionary-entry-edit-form {
    display: block;
}

.dictionary-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem 1rem;
}

.dictionary-edit-grid label,
.dictionary-edit-textarea {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: #0f172a;
    font-weight: 500;
}

.dictionary-entry-form-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
}

.dictionary-entry-card.is-editing {
    border-color: #c7d2fe;
    box-shadow: 0 12px 30px rgba(68, 100, 198, 0.12);
}

.dictionary-suggestions {
    position: absolute;
    z-index: 100000;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    border: 1px solid #e1e7f5;
    overflow: hidden;
}

.dictionary-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0.4rem 0;
    max-height: 240px;
    overflow-y: auto;
}

.dictionary-suggestion {
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.dictionary-suggestion-key {
    color: #1d4ed8;
    font-weight: 600;
    font-size: 0.95rem;
}

.dictionary-suggestion-label {
    color: #0f172a;
    font-size: 0.9rem;
}

.dictionary-suggestion-preview {
    color: #64748b;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dictionary-suggestion.active,
.dictionary-suggestion:hover {
    background: #eef2ff;
}

/* Mission variable suggestions (@ trigger) */
.dictionary-suggestion--mission .dictionary-suggestion-key {
    color: #059669;
}
.dictionary-suggestion--mission.active,
.dictionary-suggestion--mission:hover {
    background: #ecfdf5;
}

/* ── Section Variables de mission ── */

.mission-variables-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
}

.mission-variable-add-form {
    margin-bottom: 0.5rem;
}

.mission-variable-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mission-variable-field > span {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.mission-variable-field input {
    height: 36px;
    padding: 0 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
}

.mission-variable-shortcut-input {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.mission-variable-at {
    padding: 0 0.45rem;
    font-weight: 700;
    color: #059669;
    font-size: 1rem;
    background: #f0fdf4;
    height: 36px;
    display: flex;
    align-items: center;
}

.mission-variable-shortcut-input input {
    border: none;
    border-radius: 0;
    width: 120px;
    height: 34px;
}

.mission-variables-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.mission-variable-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.55rem 1rem;
}

.mission-variable-key {
    font-weight: 700;
    color: #059669;
    font-family: monospace;
    white-space: nowrap;
    font-size: 0.95rem;
}

.mission-variable-label {
    color: #475569;
    font-size: 0.85rem;
    white-space: nowrap;
}

.mission-variable-content {
    flex: 1;
    color: #64748b;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mission-variable-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.mv-edit-btn,
.mv-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px;
    font-size: 1.1rem;
    line-height: 1;
}

.mv-edit-btn:hover {
    color: #2563eb;
}

.mv-delete-btn:hover {
    color: #ef4444;
}

/* ── Popup Variables de mission (toolbar @) ── */

.mv-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.mv-popup {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.mv-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.mv-popup-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #111827;
}

.mv-popup-close {
    border: none;
    background: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.mv-popup-close:hover {
    color: #111827;
}

.mv-popup-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0.3rem 0 1rem;
    flex-shrink: 0;
}

.mv-popup-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 45vh;
}

.mv-popup-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.mv-popup-item:hover {
    background: #ecfdf5;
    border-color: #059669;
}

.mv-popup-item-key {
    font-weight: 700;
    color: #059669;
    font-family: monospace;
    white-space: nowrap;
    font-size: 0.95rem;
}

.mv-popup-item-label {
    color: #475569;
    font-size: 0.82rem;
    white-space: nowrap;
}

.mv-popup-item-content {
    flex: 1;
    color: #64748b;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mv-popup-add {
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
    flex-shrink: 0;
}

.mv-popup-add h4 {
    margin: 0 0 0.6rem;
    font-size: 0.9rem;
    color: #475569;
}

.mv-popup-add-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mv-popup-add-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.mv-popup-add-at {
    font-weight: 700;
    color: #059669;
    font-size: 1rem;
}

.mv-popup-add-row input {
    height: 36px;
    padding: 0 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem;
    flex: 1;
    min-width: 0;
}

@media (max-width: 700px) {

    .dictionary-create-card,
    .dictionary-table-card {
        padding: 1.4rem;
    }

    .dictionary-create-header {
        flex-direction: column;
    }

    .dictionary-entry-card {
        padding: 1rem;
    }

    .dictionary-entry-card-actions {
        flex-wrap: wrap;
    }
}

/* ----- Task view layout ----- */
.public-task-body {
    background: #f4f6fb;
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    padding: 0;
}

.public-task-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.task-view--finalized .task-view-color {
    background: #e2e8f0 !important;
}

.task-finalized-alert {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.85rem 1.2rem;
    background: #f8fafc;
    margin: 1rem 0 1.25rem;
}

.task-finalized-alert i {
    font-size: 1.3rem;
    color: #16a34a;
}

.task-finalized-alert strong {
    display: block;
    color: #0f172a;
}

.task-finalized-alert p {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
}

.task-finalize-btn.is-active {
    background: #16a34a;
    color: #fff;
}

.task-finalize-btn.is-active:hover {
    background: #15803d;
    color: #fff;
}

.notice-wrapper {
    max-width: 640px;
}

.task-assignment-notice-card {
    background: #fff;
    border-radius: 24px;
    padding: 2.2rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    text-align: center;
}

.task-assignment-notice-card h1 {
    margin: 0 0 1rem;
    font-size: 1.6rem;
    color: #0f172a;
}

.task-assignment-notice-card p {
    margin: 0 0 1rem;
    color: #475569;
    font-size: 1rem;
}

.task-assignment-notice-card strong {
    color: #0f172a;
}

.notice-icon {
    font-size: 2.6rem;
    color: #2563eb;
    margin-bottom: 1rem;
}

.task-view {
    max-width: 1100px;
    margin: 0 auto 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.task-view-hero {
    background: #fff;
    border-radius: 20px;
    padding: 1.8rem;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.1);
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.task-view-hero-main {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.task-view-color {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.task-view-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0 0 0.7rem;
}

.task-view-hero h1 {
    margin: 0 0 0.4rem;
    font-size: 2rem;
    color: #0f172a;
}

.task-view-description-block {
    background: #fff;
    border-radius: 20px;
    padding: 1.6rem 1.8rem;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.08);
}

.task-view-description-block h3 {
    margin: 0 0 0.6rem;
    font-size: 1.05rem;
    color: #0f172a;
    font-weight: 600;
}

.task-view-description {
    margin: 0;
    color: #475569;
    line-height: 1.55;
    font-size: 1rem;
    word-break: break-word;
}

.task-mission-share {
    background: #fff;
    border-radius: 20px;
    padding: 1.6rem 1.8rem;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.08);
}

.task-mission-share h3 {
    margin: 0 0 1rem;
    font-size: 1.2rem;
    color: #1f2937;
    font-weight: 700;
}

.task-mission-share-section+.task-mission-share-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eceff6;
}

.task-mission-share-section h4 {
    margin: 0 0 0.7rem;
    font-size: 1rem;
    color: #1f2937;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.task-mission-share-listing {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.task-mission-share-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.35rem 0;
    color: #232a3b;
    font-size: 1rem;
    line-height: 1.45;
}

.task-mission-share-row--separator {
    display: block;
    border-top: 1px dashed #e2e8f0;
    margin-top: 0.4rem;
    padding-top: 0.35rem;
    text-transform: uppercase;
    font-size: 0.88rem;
    letter-spacing: 0.05em;
    color: #5f6b85;
}

.task-mission-share-row--separator span {
    background: #fff;
    padding: 0 0.35rem;
    border-radius: 999px;
    display: inline-block;
    transform: translateY(-0.65em);
}

.task-mission-share-label {
    font-weight: 600;
    color: #0f172a;
    flex: 0 0 210px;
    max-width: 210px;
}

.task-mission-share-value {
    flex: 1;
    min-width: 0;
}

.task-mission-share-value p {
    margin: 0;
    color: #1e293b;
}

.task-mission-share-sublist {
    margin: 0.2rem 0 0;
    padding-left: 1.1rem;
    color: #1e293b;
}

.task-mission-share-files {
    margin: 0.2rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.task-mission-share-files.with-spacing {
    margin-top: 0.6rem;
}

.task-mission-share-filegroup span {
    font-weight: 600;
    color: #1f2937;
}

.task-mission-share-filegroup ul {
    margin: 0.15rem 0 0;
    padding-left: 1.1rem;
    color: #1f2937;
}

.task-mission-share-files a {
    color: #1d4ed8;
    text-decoration: none;
}

.task-mission-share-photos {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.task-mission-share-photos a {
    display: inline-flex;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #dfe3f5;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.task-mission-share-photos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

.task-mission-share-value .address-link {
    color: #1d4ed8;
    cursor: pointer;
    text-decoration: underline dotted;
}

.task-address-menu {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #dfe3f5;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
}

.task-address-menu button {
    background: none;
    border: none;
    text-align: left;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    color: #1f3a63;
    cursor: pointer;
}

.task-address-menu button:hover {
    background: #eef2ff;
}

.task-view-hero-actions {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.task-view-deadline {
    background: #eef2ff;
    border-radius: 16px;
    padding: 0.9rem 1.2rem;
    min-width: 180px;
}

.task-view-deadline span {
    display: block;
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.task-view-deadline strong {
    display: block;
    color: #1d4ed8;
    font-size: 1.05rem;
}

.task-view-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.task-view-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.2rem;
}

.task-panel {
    background: #fff;
    border-radius: 18px;
    padding: 1.4rem 1.6rem;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.task-panel-head {
    margin-bottom: 1rem;
}

.task-panel-head h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #0f172a;
}

.task-panel-head p {
    margin: 0.2rem 0 0;
    color: #64748b;
    font-size: 0.9rem;
}

.task-panel-link {
    font-size: 0.9rem;
    color: #4464c6;
    text-decoration: none;
}

.task-infos {
    display: flex;
    justify-content: space-between;
    gap: 1.4rem;
    flex-wrap: wrap;
}

.task-infos span {
    display: block;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}

.task-infos p {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
}

.task-status {
    display: inline-flex;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #1d4ed8;
    font-size: 0.85rem;
    text-transform: capitalize;
}

.task-panel-assignees ul,
.task-assignee-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.task-assignee-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #edf1fb;
    padding-bottom: 0.6rem;
}

.task-assignee-list li:last-child {
    border-bottom: none;
}

.task-assignee-company {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
}

.task-assignee-badge {
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.task-assignee-badge--pending {
    background: #fff7ed;
    color: #c2410c;
}

.task-assignee-badge--accepted {
    background: #ecfdf5;
    color: #047857;
}

.task-assignee-badge--declined {
    background: #fef2f2;
    color: #b91c1c;
}

.task-files {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 0;
    margin: 0;
}

.task-files--with-thumbs {
    border-top: 1px solid #e3e8f5;
    padding-top: 0.9rem;
}

.task-files-group-title {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.task-files-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.task-files-thumbs a.task-thumb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    text-decoration: none;
}

/* Fallback for old markup without .task-thumb-item */
.task-files-thumbs a:not(.task-thumb-item) {
    display: inline-flex;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.task-files-thumbs img {
    width: 80px;
    height: 68px;
    object-fit: cover;
    display: block;
}

.task-thumb-name {
    display: block;
    width: 100%;
    padding: 3px 4px;
    font-size: 0.58rem;
    line-height: 1.2;
    color: #475569;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.task-files-thumbs a:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.13);
}

.task-files-thumbs a img {
    cursor: zoom-in;
}

.task-files-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.task-files-list li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.96rem;
}

.task-files-list li span {
    color: #94a3b8;
}

.task-files-list a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}

.task-file-preview {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    border-radius: 12px;
    border: 1px solid #dfe3f5;
    box-shadow: 0 24px 40px rgba(15, 23, 42, 0.28);
    background: #fff;
    overflow: hidden;
    display: none;
}

.task-file-preview img {
    display: block;
    max-width: 340px;
    max-height: 260px;
    object-fit: contain;
}

.task-empty {
    color: #94a3b8;
    margin: 0;
}

.task-panel-activity {
    margin-top: 0.5rem;
}

.task-activity-composer {
    border: 1px solid #e3e8f5;
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f8f9ff;
    position: relative;
}

.task-activity-composer.is-uploading::after {
    content: 'Transfert des fichiers en cours…';
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

.task-activity-composer.is-uploading .task-activity-actions .btn-primary {
    opacity: 0.6;
    pointer-events: none;
}

.task-activity-uploader {
    margin-top: 0.8rem;
}

.task-activity-uploaded {
    list-style: none;
    padding: 0.4rem 0 0;
    margin: 0;
    font-size: 0.88rem;
    color: #475569;
}

.task-activity-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.9rem;
}

.task-activity-message {
    font-size: 0.9rem;
}

.task-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.task-activity-item {
    border: 1px solid #e3e8f5;
    border-radius: 16px;
    padding: 0.9rem 1rem;
    background: #fff;
}

.task-activity-item.is-report {
    border-color: #c7d2fe;
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.12);
}

.task-activity-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.task-activity-meta-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.task-activity-meta-primary {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.task-activity-meta strong {
    display: inline-flex;
    color: #111827;
}

.task-activity-meta-separator {
    color: #cbd5f5;
}

.task-activity-meta-date {
    font-size: 0.85rem;
    color: #94a3b8;
}

.note-report-pill {
    background: #eef2ff;
    color: #334155;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.05rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
}

.task-activity-meta small {
    font-size: 0.78rem;
    color: #94a3b8;
}

.task-activity-actions-line {
    display: flex;
    gap: 0.3rem;
}

.task-icon-btn {
    border: none;
    background: #eef2ff;
    color: #1d4ed8;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0;
}

.task-icon-btn i {
    font-size: 0.9rem;
    color: inherit;
    pointer-events: none;
}

.task-icon-btn.report-toggle.is-active {
    background: #1d4ed8;
    color: #fff;
}

.task-icon-btn.danger {
    background: #fee2e2;
    color: #dc2626;
}

.task-activity-content {
    margin: 0.6rem 0 0;
    color: #111827;
    line-height: 1.42;
}

.task-activity-content img {
    cursor: pointer;
    max-width: 100%;
    border-radius: 4px;
}

/* Miroir des règles Quill 1.3.7 pour que le rendu en liste corresponde
   exactement à l'éditeur (sinon les <p>/listes/blockquote héritent des
   marges navigateur par défaut et le contenu paraît plus "aéré"). */
.task-activity-content p,
.task-activity-content ol,
.task-activity-content ul,
.task-activity-content pre,
.task-activity-content blockquote,
.task-activity-content h1,
.task-activity-content h2,
.task-activity-content h3,
.task-activity-content h4,
.task-activity-content h5,
.task-activity-content h6 {
    margin: 0;
    padding: 0;
}

.task-activity-content blockquote {
    border-left: 4px solid #ccc;
    padding-left: 16px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.task-activity-content ol,
.task-activity-content ul {
    padding-left: 1.5em;
}

.task-activity-content pre {
    background-color: #f0f0f0;
    border-radius: 3px;
    padding: 5px 10px;
    white-space: pre-wrap;
}

.task-activity-files {
    margin-top: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.task-activity-file {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #dfe4fb;
    background: #f8faff;
}

.task-activity-file a {
    text-decoration: none;
    color: #4464c6;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.task-activity-file a[data-preview-url] {
    cursor: zoom-in;
}

.task-activity-file-remove {
    border: none;
    background: none;
    color: #9ca3af;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.task-activity-file-remove:hover {
    color: #dc2626;
}

/* ── Notes complément rapport ── */

.note-complement-pill {
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    padding: 0.05rem 0.55rem;
    border-radius: 999px;
    font-weight: 500;
}

.complement-added-at {
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
}

/* Bouton ajouter complément entre les notes */
.task-activity-intercaler {
    text-align: center;
    padding: 0 !important;
    list-style: none;
    margin: -0.3rem 0;
}

.intercaler-btn {
    border: 1px dashed #e2e8f0;
    background: transparent;
    color: #94a3b8;
    padding: 0.15rem 1rem;
    border-radius: 999px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.intercaler-btn:hover {
    border-color: #94a3b8;
    color: #475569;
    background: #f8fafc;
}

/* Ligne sélecteur heure dans le composer */
.complement-time-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.complement-time-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.complement-time-row input[type="time"],
.complement-time-row input[type="date"] {
    padding: 0.3rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
}

.complement-time-row small {
    font-size: 0.78rem;
    color: #94a3b8;
    font-style: italic;
}

@media (max-width: 860px) {
    .task-view-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.task-pack-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.task-pack-modal.open {
    display: flex;
}

.task-pack-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.task-pack-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
    width: min(640px, 92vw);
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}

.task-pack-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.task-pack-modal-subtitle {
    margin: 0.3rem 0 0;
    color: #5b6786;
    font-size: 0.95em;
}

.task-pack-modal .modal-close {
    border: none;
    background: #f1f5f9;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    color: #475569;
}

.pack-tasks-container {
    margin: 1rem 0 1.3rem 0;
}

.task-pack-form .modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.task-pack-form label {
    font-weight: 600;
    color: #1f2f51;
}

.task-pack-form .select-wrapper {
    position: relative;
}

.task-pack-form select {
    width: 100%;
    border: 1px solid #d7dce8;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    appearance: none;
    background: #f8fafc;
}

.task-pack-form select:focus {
    outline: none;
    border-color: #7f9cf5;
    box-shadow: 0 0 0 3px rgba(127, 156, 245, 0.25);
}

.task-pack-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.3rem;
}

.task-pack-footer .ghost {
    border: 1px solid #cfd6ed;
    color: #1d3fbf;
}

.task-pack-footer .btn-primary.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.task-pack-footer .btn-primary.is-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

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

.task-pack-feedback .form-success,
.task-pack-feedback .form-error {
    margin-top: 0.6rem;
}

@media (max-width: 640px) {
    .task-view-hero {
        padding: 1.2rem;
    }

    .task-view-description-block {
        padding: 1.1rem;
    }

    .task-panel {
        padding: 1.1rem;
    }
}

.kit-hero-search .btn-secondary {
    align-self: center;
}

#mission-model-actions,
.mission-model-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

#mission-model-actions .btn-secondary,
.mission-model-actions .btn-secondary {
    flex: 0 1 auto;
    min-width: 150px;
    max-width: 220px;
    width: auto !important;
    box-sizing: border-box;
}

#mission-model-actions .mission-model-select,
.mission-model-actions .mission-model-select {
    flex: 0 1 auto;
    min-width: 160px;
    max-width: 240px;
    width: auto !important;
    text-align: left;
    text-align-last: left;
}

@media (max-width: 520px) {

    #mission-model-actions,
    .mission-model-actions {
        justify-content: flex-start;
    }
}

/* Timeline */
.timeline-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1.25rem;
    box-sizing: border-box;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.timeline-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.35em;
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 0 0 0.3rem;
}

.timeline-header h1 {
    margin: 0 0 0.6rem;
}

.timeline-header p {
    margin: 0;
    color: #475569;
}

.timeline-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-top: 0.5rem;
}

/* Toggle finalized button */
.timeline-toggle-finalized {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 50px;
    background: #fff;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
    white-space: nowrap;
}
.timeline-toggle-finalized:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
}
.timeline-toggle-finalized.active {
    background: #eff6ff;
    border-color: #4f8cff;
    color: #2563eb;
}
.timeline-toggle-finalized i {
    font-size: 0.82rem;
}

/* Finalized cards : muted look */
.timeline-item-finalized .timeline-card {
    opacity: 0.48;
    filter: grayscale(0.45);
    transition: opacity 0.2s, filter 0.2s;
}
.timeline-item-finalized .timeline-card:hover {
    opacity: 0.75;
    filter: grayscale(0.2);
}
.timeline-item-finalized .timeline-dot {
    opacity: 0.4;
}

.timeline-empty {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    color: #475569;
}

/* -- Alternating timeline layout -- */
.timeline-alt {
    position: relative;
    padding: 1.5rem 0 4rem;
}

.timeline-alt .timeline-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: linear-gradient(to bottom, transparent, #e2e8f0 5%, #e2e8f0 95%, transparent);
}

/* Day label badge */
.timeline-day-label {
    position: relative;
    z-index: 2;
    text-align: center;
    margin: 0.5rem 0 1.5rem;
    clear: both;
}

.timeline-day-label span {
    display: inline-block;
    background: #f5f6f8;
    padding: 6px 18px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.timeline-day-label span.is-today {
    background: #4f8cff;
    color: #fff;
    border-color: #4f8cff;
}

/* Timeline item (alternating left/right) */
.timeline-item {
    position: relative;
    width: 50%;
    padding-bottom: 1.75rem;
    box-sizing: border-box;
}

.timeline-item.timeline-left {
    padding-right: 2.5rem;
    clear: both;
}

.timeline-item.timeline-right {
    margin-left: 50%;
    padding-left: 2.5rem;
    clear: both;
}

/* Dot on the center line */
.timeline-dot {
    position: absolute;
    top: 1.1rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4f8cff;
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px rgba(79,140,255,0.25), 0 2px 6px rgba(0,0,0,0.12);
    z-index: 3;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.timeline-item:hover .timeline-dot {
    transform: scale(1.25);
    box-shadow: 0 0 0 4px rgba(79,140,255,0.3), 0 2px 8px rgba(0,0,0,0.15);
}

.timeline-left .timeline-dot {
    right: -7px;
}

.timeline-right .timeline-dot {
    left: -7px;
}

/* ══════════════════════════════════════
   TIMELINE CARD — Design moderne 2026
   ══════════════════════════════════════ */
.timeline-card {
    display: block;
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.05);
    border: none;
    text-decoration: none;
    color: #0f172a;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    text-align: left;
    overflow: hidden;
}

.timeline-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 36px rgba(var(--timeline-card-accent-rgb, 79,140,255), 0.22),
                0 3px 10px rgba(0,0,0,0.08);
}

/* ── Header coloré ── */
.timeline-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: var(--timeline-card-accent, #4f8cff);
    background: linear-gradient(135deg,
        var(--timeline-card-accent, #4f8cff) 0%,
        color-mix(in srgb, var(--timeline-card-accent, #4f8cff) 70%, #000) 100%);
}

.timeline-card-date-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.timeline-card-date {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.01em;
}

.timeline-card-time {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.22);
    padding: 2px 9px;
    border-radius: 6px;
}

/* ── Status badge (dans le header) ── */
.timeline-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.22);
    color: #fff;
    white-space: nowrap;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(4px);
}
.timeline-status::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fff;
    flex-shrink: 0;
}

/* Overrides statut — dans le header tout reste blanc, on joue sur l'opacité */
.timeline-status.status-terminée,
.timeline-status.status-done {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}
.timeline-status.status-en-cours,
.timeline-status.status-in-progress {
    background: rgba(255,255,255,0.2);
}
.timeline-status.status-todo,
.timeline-status.status-à-faire,
.timeline-status.status-pending {
    background: rgba(0,0,0,0.18);
    border-color: rgba(255,255,255,0.25);
}

/* ── Corps de la carte ── */
.timeline-card-inner {
    padding: 1rem 1.25rem 0.9rem 1.25rem;
}

.timeline-card h3 {
    margin: 0.9rem 0 0.65rem;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.45;
    color: #1e293b;
}

/* ── Chips ── */
.timeline-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.timeline-recurrence-frequency {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: #ede9fe;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}
.timeline-recurrence-frequency i { font-size: 0.6rem; }

.timeline-mission-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(var(--timeline-card-accent-rgb, 79,140,255), 0.1);
    color: var(--timeline-card-accent, #4f8cff);
    border: 1px solid rgba(var(--timeline-card-accent-rgb, 79,140,255), 0.22);
}
.timeline-mission-chip::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ── Footer dates ── */
.timeline-dates {
    list-style: none;
    margin: 0;
    padding: 0.55rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    background: #f8fafc;
    border-top: 1px solid #f0f4f8;
}

.timeline-dates li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.timeline-dates-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.timeline-dates li span:last-child {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    font-variant-numeric: tabular-nums;
}

/* ── Flèche connecteur ── */
.timeline-left .timeline-card::after {
    content: '';
    position: absolute;
    top: 1.1rem;
    right: -8px;
    width: 0; height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 9px solid var(--timeline-card-accent, #4f8cff);
    z-index: 4;
}
.timeline-right .timeline-card::after {
    content: '';
    position: absolute;
    top: 1.1rem;
    left: -8px;
    width: 0; height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 9px solid var(--timeline-card-accent, #4f8cff);
    z-index: 4;
}

/* Floating buttons */
.timeline-floating-btn {
    position: fixed;
    right: 26px;
    bottom: 100px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #272E40;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 1rem;
}

.timeline-floating-btn:hover {
    transform: scale(1.08);
}

.timeline-floating-btn-secondary {
    bottom: 160px;
    background: #4f8cff;
}

.timeline-floating-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* -- Timeline responsive -- */
@media (max-width: 992px) {
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .timeline-header-actions {
        margin-top: 1rem;
        width: 100%;
    }
    .timeline-toggle-finalized {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .timeline-alt .timeline-line {
        left: 20px;
        transform: none;
    }

    .timeline-day-label {
        text-align: left;
        padding-left: 48px;
    }

    .timeline-item,
    .timeline-item.timeline-left,
    .timeline-item.timeline-right {
        width: 100%;
        margin-left: 0;
        padding-left: 48px;
        padding-right: 0;
    }

    .timeline-left .timeline-dot,
    .timeline-right .timeline-dot {
        left: 13px;
        right: auto;
    }

    .timeline-left .timeline-card::after,
    .timeline-right .timeline-card::after {
        left: -7px;
        right: auto;
        border-right: none;
        border-top: none;
        border-left: 1px solid #e9ecef;
        border-bottom: 1px solid #e9ecef;
    }
}

@media (max-width: 500px) {
    .timeline-card {
        padding: 1rem 1.15rem;
    }

    .timeline-card h3 {
        font-size: 1rem;
    }

    .timeline-floating-btn,
    .timeline-floating-btn-secondary {
        right: 16px;
    }
}

/* --- PWA install banner --- */
.pwa-install-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 14px;
    z-index: 1200;
    background: #0f172a;
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.3);
    padding: 12px 14px;
    display: none;
}

.pwa-install-banner.show {
    display: block;
}

.pwa-install-inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.pwa-install-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pwa-install-title {
    margin: 0;
    font-weight: 700;
    font-size: 1.05rem;
}

.pwa-install-desc {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.45;
}

.pwa-install-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: #4464c6;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 9px 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(68, 100, 198, 0.35);
}

.pwa-install-btn:hover {
    background: #3655ad;
}

.pwa-install-close {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    padding: 9px 12px;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 720px) {
    .pwa-install-inner {
        flex-direction: column;
    }

    .pwa-install-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* --- Quill Editor Fixes for Spacing --- */
.ql-editor p {
    margin-bottom: 0;
}

.ql-editor ul,
.ql-editor ol {
    margin-top: 0;
    margin-bottom: 0;
    padding-left: 1.5em;
    /* Ensure indentation matches view */
}

.ql-editor li {
    margin-bottom: 0;
    /* Tighten list items if needed */
}

@media (max-width: 600px) {
    .model-section-head {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .model-head-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .model-search {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .model-head-actions .btn-secondary {
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }
}

/* ── Task Summary Section ── */
.task-summary-section {
    margin-top: 2rem;
    padding: 1.2rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.task-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.task-summary-title {
    font-size: 1.05rem;
    color: #334155;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-summary-prompt-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    padding: 0.35em 0.65em;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.task-summary-prompt-btn:hover {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.task-summary-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.task-summary-message {
    font-size: 0.85rem;
    transition: opacity 0.3s;
}

/* ── AI Generate button ── */
.btn-ai-generate {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5em 1.1em;
    font-size: 0.9rem;
    font-weight: 600;
    color: #7c3aed;
    background: linear-gradient(135deg, #ede9fe 0%, #f5f3ff 100%);
    border: 1px solid #c4b5fd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ai-generate:hover {
    background: linear-gradient(135deg, #ddd6fe 0%, #ede9fe 100%);
    border-color: #a78bfa;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.15);
    transform: translateY(-1px);
}

.btn-ai-generate:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-ai-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-ai-generate i {
    font-size: 0.85em;
}

.ai-beta-pill {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    padding: 0.2em 0.55em;
    border-radius: 20px;
    line-height: 1;
}

/* ── Prompt Customization Popup ── */
.prompt-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.prompt-popup {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.prompt-popup-textarea {
    min-height: 220px;
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.8rem;
    font-size: 0.88rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    color: #334155;
    box-sizing: border-box;
}

.prompt-popup-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

@media (max-width: 600px) {
    .task-summary-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .task-summary-actions .btn-ai-generate,
    .task-summary-actions .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .prompt-popup {
        max-width: 100%;
        border-radius: 12px;
    }
}

/* ════════════════════════════════════════
   Task Report Generation Modal
   ════════════════════════════════════════ */

.task-report-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-report-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}

.task-report-modal-panel {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.2);
    width: 560px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.task-report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
}

.task-report-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: #1e293b;
}

.task-report-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.task-report-modal-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.task-report-modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
}

.task-report-modal-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 22px;
    border-top: 1px solid #e2e8f0;
}

.task-report-footer-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.task-report-footer-row > button {
    flex: 1 1 0;
    justify-content: center;
}

.task-report-footer-row.task-report-footer-center > button {
    flex: 0 1 auto;
}

.task-report-section {
    margin-bottom: 18px;
}

.task-report-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 8px;
}

.task-report-select {
    width: 100%;
    border: 1px solid #d1d5db;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: #1e293b;
}

.task-report-input {
    width: 100%;
    border: 1px solid #d1d5db;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1e293b;
    box-sizing: border-box;
}

.task-report-input:focus,
.task-report-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Metrics */
.task-report-metric-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.task-report-metric-label {
    flex: 0 0 140px;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
}

.task-report-metric-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-report-metric-input {
    width: auto;
    flex: 1;
}

.task-report-metric-suffix {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

/* Notes list */
.task-report-notes-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px;
}

.task-report-note-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 0.88rem;
    color: #64748b;
}

.task-report-note-item:hover {
    background: #f8fafc;
}

.task-report-note-item.is-included {
    color: #1e293b;
}

.task-report-note-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    flex-shrink: 0;
}

.task-report-note-time {
    font-weight: 600;
    font-size: 0.82rem;
    color: #2563eb;
    flex-shrink: 0;
    min-width: 38px;
}

.task-report-note-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-report-toggle-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s, color 0.15s;
}

.task-report-toggle-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Mobile */
@media (max-width: 640px) {
    .task-report-modal-panel {
        width: 100%;
        max-height: 95vh;
        border-radius: 14px 14px 0 0;
        margin-top: auto;
    }

    .task-report-metric-row {
        flex-wrap: wrap;
    }

    .task-report-metric-label {
        flex: 0 0 100%;
    }

    .task-report-footer-row {
        flex-direction: column;
    }

    .task-report-footer-row button {
        width: 100%;
        justify-content: center;
    }

    .task-report-email-chip {
        max-width: 100%;
    }
}

/* ═══════════════════════════════════════════════════ */
/* ── Report Template Form — Logo preview ── */
/* ═══════════════════════════════════════════════════ */

.report-tpl-logo-preview {
    max-width: 200px;
    max-height: 80px;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px;
    background: #f8fafc;
}

/* Sections checkboxes */
.report-tpl-sections {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.report-tpl-sections > label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.12s;
    margin: 0;
}

.report-tpl-sections > label:last-child {
    border-bottom: none;
}

.report-tpl-sections > label:hover {
    background: #f8fafc;
}

.report-tpl-sections > label > input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 3px;
}

.report-tpl-sections > label > div {
    flex: 1;
    min-width: 0;
}

.report-tpl-sections > label > div > strong {
    display: block;
    font-size: 0.95rem;
    color: #1e293b;
    line-height: 1.3;
}

/* ═══════════════════════════════════════════════════ */
/* ── Task Report — Email Panel (cohérent contact_form) ── */
/* ═══════════════════════════════════════════════════ */

.task-report-email-panel {
    border-top: 1px solid #e2e8f0;
    padding: 16px 0 0;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Field row */
.task-report-email-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-report-email-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Sender box */
.task-report-email-sender {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.task-report-email-sender-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.task-report-email-sender-info strong {
    font-size: 0.92rem;
    color: #1e293b;
}

.task-report-email-sender-info span {
    font-size: 0.82rem;
    color: #94a3b8;
}

/* Recipients wrapper */
.task-report-email-recipients {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 8px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.task-report-email-recipients:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Chips container */
.task-report-email-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.task-report-email-chips:not(:empty) {
    margin-bottom: 6px;
}

/* Individual chip */
.task-report-email-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 3px 6px 3px 10px;
    font-size: 0.85rem;
    color: #1e293b;
    max-width: 280px;
    animation: chipIn 0.15s ease-out;
}

@keyframes chipIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

.task-report-email-chip-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-report-email-chip-email {
    font-size: 0.78rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-report-email-chip-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 50%;
    transition: background 0.12s, color 0.12s;
    flex-shrink: 0;
}

.task-report-email-chip-remove:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Search input inside recipients box */
.task-report-email-search-wrap {
    position: relative;
}

.task-report-email-search-input {
    width: 100%;
    border: none;
    outline: none;
    padding: 5px 4px;
    font-size: 0.92rem;
    color: #1e293b;
    background: transparent;
    box-sizing: border-box;
}

.task-report-email-search-input::placeholder {
    color: #94a3b8;
}

/* Search results dropdown — style "Contacts raccourcis" */
.task-report-email-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: -9px;
    right: -9px;
    z-index: 200;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

.task-report-email-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s;
}

.task-report-email-result:last-child {
    border-bottom: none;
}

.task-report-email-result:hover {
    background: #f8fafc;
}

.task-report-email-result--empty {
    cursor: default;
    color: #94a3b8;
    font-style: italic;
    justify-content: center;
    padding: 1rem;
}

.task-report-email-result-avatar {
    width: 36px;
    height: 36px;
    background: #e0e7ff;
    color: #4f46e5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9em;
    flex-shrink: 0;
}

.task-report-email-result-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.task-report-email-result-name {
    font-weight: 600;
    font-size: 0.95em;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-report-email-result-email {
    font-size: 0.8em;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Subject input */
.task-report-email-input {
    width: 100%;
    border: 1px solid #d1d5db;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1e293b;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.task-report-email-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Editor wrapper */
.task-report-email-editor-wrap {
    border-radius: 8px;
    overflow: hidden;
}

.task-report-email-editor-wrap .ql-toolbar {
    border-radius: 8px 8px 0 0;
    border-color: #d1d5db;
}

.task-report-email-editor-wrap .ql-container {
    border-radius: 0 0 8px 8px;
    border-color: #d1d5db;
}

.task-report-email-editor-wrap .ql-editor {
    min-height: 120px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ===== AUTH LAYOUT (login, register, forgot, reset) ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #272E40 0%, #1a2332 100%);
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 36px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.auth-card .auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-card .auth-logo img {
    height: 44px;
    max-width: 200px;
    object-fit: contain;
}

.auth-card h2 {
    text-align: center;
    margin: 0 0 6px;
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 700;
}

.auth-card-intro {
    text-align: center;
    color: #64748b;
    margin: 0 0 24px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-card .login-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.auth-card .login-form label span {
    font-weight: 600;
    font-size: 0.92rem;
    color: #334155;
}

.auth-card .login-form input[type="email"],
.auth-card .login-form input[type="password"],
.auth-card .login-form input[type="text"] {
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-card .login-form input:focus {
    outline: none;
    border-color: #4f8cff;
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.12);
}

.auth-card .btn-primary {
    width: 100%;
    padding: 12px;
    background: #4f8cff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.auth-card .btn-primary:hover {
    background: #3d7bf7;
}

.auth-card .login-help {
    text-align: center;
    margin-top: 18px;
    font-size: 0.92rem;
}

.auth-card .login-help a {
    color: #4f8cff;
    font-weight: 600;
    text-decoration: none;
}

.auth-card .login-help a:hover {
    text-decoration: underline;
}

.auth-card .form-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.92rem;
    border: 1px solid #fecaca;
}

.auth-card .form-success {
    background: #f0fdf4;
    color: #16a34a;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.92rem;
    border: 1px solid #bbf7d0;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: #94a3b8;
}

.auth-footer a {
    color: #cbd5e1;
    text-decoration: none;
}

.auth-footer a:hover {
    color: #fff;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px;
    }
}

/* ===== Security Badge ===== */
.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    padding: 3px 10px;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 99px;
    font-size: 0.85em;
    font-weight: 500;
    vertical-align: middle;
    cursor: help;
    transition: all 0.2s;
}

.security-badge:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: translateY(-1px);
}