/* ==========================================================================
   Chronos — page Meetings (préfixe `mt-`) + formulaire de la modale
   ========================================================================== */

.mt {
    --mt-surface: rgba(22, 23, 26, 0.82);
    --mt-card: rgba(26, 27, 31, 0.88);
    --mt-line: rgba(255, 255, 255, 0.08);
    --mt-line-strong: rgba(255, 255, 255, 0.16);
    --mt-text: #eceef2;
    --mt-muted: #9aa1ad;
    --mt-faint: #6b7280;
    --mt-accent: #7aa7ff;
    --mt-amber: #f5b94a;
    --mt-bad: #f87171;

    max-width: 1040px;
    margin: 0 auto;
    padding: 20px 24px 48px;
    color: var(--mt-text);
}
.mt [hidden] { display: none !important; }
.mt button { font-family: inherit; cursor: pointer; }

/* ---------- En-tête ------------------------------------------------------ */

.mt-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.mt-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75);
}
.mt-title i { color: var(--mt-accent); font-size: 1.6rem; }
.mt-head-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }

.mt-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 300px;
    max-width: 100%;
}
.mt-search > i { position: absolute; left: 12px; font-size: 15px; color: var(--mt-faint); pointer-events: none; }
.mt-search input {
    width: 100%;
    height: 36px;
    padding: 0 34px 0 36px;
    font-size: 13.5px;
    color: var(--mt-text);
    background: var(--mt-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--mt-line);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mt-search input::placeholder { color: var(--mt-faint); }
.mt-search input:focus { outline: none; border-color: var(--mt-accent); box-shadow: 0 0 0 3px rgba(122, 167, 255, 0.2); }
.mt-search button {
    position: absolute;
    right: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--mt-muted);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
}

.mt-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 16px;
    font-size: 13.5px;
    font-weight: 700;
    color: #0b1220;
    background: var(--mt-accent);
    border: none;
    border-radius: 10px;
    box-shadow: 0 6px 18px -6px rgba(122, 167, 255, 0.7);
    transition: background-color 0.15s ease, transform 0.1s ease;
}
.mt-primary:hover { background: #9dbfff; }
.mt-primary:active { transform: scale(0.97); }
.mt-primary i { font-size: 17px; }

.mt-ghost {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mt-text);
    background: var(--mt-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--mt-line);
    border-radius: 10px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.mt-ghost:hover { border-color: var(--mt-line-strong); background: rgba(40, 41, 46, 0.9); }
.mt-ghost.is-set { color: var(--mt-accent); border-color: rgba(122, 167, 255, 0.5); }
.mt-link { font-size: 12.5px; font-weight: 600; color: var(--mt-accent); background: none; border: none; }
.mt-link:hover { text-decoration: underline; }

/* ---------- Onglets + période ------------------------------------------- */

.mt-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.mt-tabs {
    display: inline-flex;
    padding: 4px;
    gap: 2px;
    background: var(--mt-surface);
    backdrop-filter: blur(10px);
    border: 1px solid var(--mt-line);
    border-radius: 12px;
}
.mt-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mt-muted);
    background: transparent;
    border: none;
    border-radius: 9px;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.mt-tab:hover { color: #fff; }
.mt-tab.is-active { color: #fff; background: rgba(122, 167, 255, 0.2); box-shadow: inset 0 0 0 1px rgba(122, 167, 255, 0.4); }
.mt-count {
    min-width: 20px;
    padding: 0 6px;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    color: var(--mt-muted);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}
.mt-tab.is-active .mt-count { color: #0b1220; background: var(--mt-accent); }

.mt-range { position: relative; }
.mt-range-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--mt-muted);
    background: #1d1e22;
    border: 1px solid var(--mt-line-strong);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    animation: mtPop 0.14s ease;
}
@keyframes mtPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.mt-range-pop label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.mt-range-pop input[type="date"],
.mt-form input[type="datetime-local"] {
    padding: 6px 9px;
    font-size: 13px;
    color: var(--mt-text, #eceef2);
    background: #121317;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color-scheme: dark;
}
.mt-range-pop input:focus { outline: none; border-color: var(--mt-accent); }

/* ---------- Liste groupée par jour -------------------------------------- */

.mt-list { display: flex; flex-direction: column; gap: 22px; animation: mtRise 0.25s ease; }
@keyframes mtRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mt-group { display: flex; flex-direction: column; gap: 8px; }
.mt-day {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 2px;
    padding: 0 2px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mt-muted);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
.mt-day em { font-style: normal; font-size: 11.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--mt-faint); }
.mt-group.is-today .mt-day { color: var(--mt-accent); }

.mt-card {
    position: relative;
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    padding: 14px 16px 14px 14px;
    background: var(--mt-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--mt-line);
    border-left: 3px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    box-shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.mt-card:hover { border-color: var(--mt-line-strong); border-left-color: var(--mt-accent); box-shadow: 0 16px 36px -16px rgba(0, 0, 0, 0.9); }
.mt-card.is-today { border-left-color: var(--mt-accent); }
.mt-card.is-next { border-color: rgba(122, 167, 255, 0.45); border-left-color: var(--mt-accent); background: linear-gradient(90deg, rgba(122, 167, 255, 0.1), var(--mt-card) 40%); }
.mt-card.is-past { opacity: 0.8; }
.mt-card.is-past:hover { opacity: 1; }

.mt-time { display: flex; flex-direction: column; gap: 2px; padding-top: 1px; }
.mt-time strong { font-size: 1.45rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: #fff; font-variant-numeric: tabular-nums; }
.mt-time span { font-size: 11.5px; color: var(--mt-faint); }
.mt-card.is-next .mt-time span { color: var(--mt-accent); font-weight: 600; }

.mt-body { min-width: 0; }
.mt-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mt-line h3 {
    margin: 0;
    padding: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    border: none;
    overflow-wrap: anywhere;
}
.mt-badge {
    padding: 1px 9px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #0b1220;
    background: var(--mt-accent);
    border-radius: 999px;
}

.mt-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mt-person {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 3px;
    font-size: 12px;
    color: var(--mt-text);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}
.mt-person b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 9.5px;
    font-weight: 700;
    color: #0b1220;
    background: hsl(var(--h), 70%, 72%);
    border-radius: 50%;
}
.mt-more-people { padding-left: 10px; color: var(--mt-muted); }

.mt-snippet {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 8px 0 0;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
    color: var(--mt-muted);
    overflow-wrap: anywhere;
}
.mt-card.is-open .mt-snippet { display: none; }
.mt-toggle {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 6px;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--mt-accent);
    background: none;
    border: none;
}
.mt-toggle i { font-size: 16px; transition: transform 0.18s ease; }
.mt-toggle:hover { text-decoration: underline; }
.mt-card.is-open .mt-toggle i { transform: rotate(180deg); }

.mt-notes {
    margin-top: 10px;
    padding: 14px 18px;
    cursor: default;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--mt-line);
    border-radius: 12px;
    animation: mtRise 0.2s ease;
}

/* Actions : visibles au survol (toujours sur tactile) */
.mt-actions { display: flex; align-items: center; min-height: 32px; }
.mt-actions-main { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s ease; }
.mt-card:hover .mt-actions-main, .mt-card:focus-within .mt-actions-main { opacity: 1; }
.mt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 16px;
    color: var(--mt-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 9px;
    transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.mt-icon:hover { color: #fff; background: rgba(255, 255, 255, 0.11); border-color: var(--mt-line-strong); }
.mt-icon.mt-danger:hover { color: #fecaca; background: rgba(248, 113, 113, 0.18); border-color: rgba(248, 113, 113, 0.5); }
.mt-actions-confirm { display: none; align-items: center; gap: 6px; font-size: 12.5px; color: #fecaca; }
.mt-card.is-confirming .mt-actions-main { display: none; }
.mt-card.is-confirming .mt-actions-confirm { display: inline-flex; }
.mt-actions-confirm button { height: 28px; padding: 0 12px; font-size: 12.5px; font-weight: 700; border-radius: 8px; border: 1px solid transparent; }
.mt-yes { color: #fff; background: #c0392b; }
.mt-yes:hover { background: #d94635; }
.mt-no { color: var(--mt-text); background: rgba(255, 255, 255, 0.08); }
.mt-no:hover { background: rgba(255, 255, 255, 0.15); }

/* ---------- État vide ---------------------------------------------------- */

.mt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-width: 440px;
    margin: 40px auto;
    padding: 34px 26px;
    text-align: center;
    background: rgba(22, 23, 26, 0.75);
    backdrop-filter: blur(12px);
    border: 1px dashed var(--mt-line-strong);
    border-radius: 18px;
}
.mt-empty > i { font-size: 36px; color: var(--mt-faint); }
.mt-empty h3 { margin: 4px 0 0; padding: 0; font-size: 1.1rem; font-weight: 700; color: #fff; border: none; }
.mt-empty p { margin: 0 0 12px; font-size: 13.5px; color: var(--mt-muted); }

/* ---------- Responsive --------------------------------------------------- */

@media (max-width: 760px) {
    .mt { padding: 12px; }
    .mt-card { grid-template-columns: 62px minmax(0, 1fr); }
    .mt-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .mt-actions-main { opacity: 1; }
    .mt-search { width: 100%; }
    .mt-head-right { width: 100%; margin-left: 0; }
    .mt-row { grid-template-columns: 1fr; }
    .mt-time strong { font-size: 1.15rem; }
}
@media (hover: none) { .mt-actions-main { opacity: 1; } }

/* Icône de recherche au-dessus du champ (le flou du champ crée son propre empilement) */
.mt-search > i { z-index: 1; }

/* ---------- Formulaire (modale) ----------------------------------------- */

/* La modale s'élargit pour ce formulaire */
#modal-scroll-container:has(#edit-meeting-form) { max-width: 980px; }

.mt-form { --f-accent: #7aa7ff; --f-line: rgba(255, 255, 255, 0.1); --f-muted: #9aa1ad; --f-faint: #6b7280; padding: 0; color: #eceef2; }
.mt-form button { font-family: inherit; }
.mt-form [hidden] { display: none !important; }
.mt-form kbd { height: 17px; min-width: 17px; font-size: 10px; }

/* En-tête : grand titre libre */
.mt-f-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 28px 18px;
    border-bottom: 1px solid var(--f-line);
}
.mt-f-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    font-size: 24px;
    color: var(--f-accent);
    background: rgba(122, 167, 255, 0.14);
    border-radius: 14px;
}
#modal-content .mt-f-title {
    flex: 1;
    min-width: 0;
    height: auto;
    padding: 6px 2px;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #fff;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transition: border-color 0.15s ease;
}
#modal-content .mt-f-title:focus { border-bottom-color: var(--f-accent) !important; outline: none; }
#modal-content .mt-f-title::placeholder { color: var(--f-faint); font-weight: 600; }
.mt-f-mode {
    flex-shrink: 0;
    padding: 3px 11px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--f-muted);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

/* Corps : 2 colonnes */
.mt-f-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 0; }
.mt-f-side { padding: 20px 22px 20px 28px; border-right: 1px solid var(--f-line); display: flex; flex-direction: column; gap: 22px; }
.mt-f-notes { padding: 20px 28px 16px 22px; min-width: 0; }

#modal-content .mt-f-block h3,
#modal-content .mt-f-notes h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    padding: 0;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--f-muted);
    border: none;
}
.mt-f-block h3 i, .mt-f-notes h3 i { font-size: 15px; color: var(--f-accent); }

/* Date + heure */
.mt-f-when { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; }
#modal-content .mt-f-when input {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
    color: #eceef2;
    background: #121317;
    border: 1px solid var(--f-line);
    border-radius: 10px;
    color-scheme: dark;
}
#modal-content .mt-f-when input:focus { border-color: var(--f-accent); box-shadow: 0 0 0 3px rgba(122, 167, 255, 0.22); outline: none; }

.mt-f-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mt-f-chips button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--f-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.mt-f-chips button:hover { color: #fff; background: rgba(255, 255, 255, 0.11); }
.mt-f-chips button.is-on { color: #0b1220; background: var(--f-accent); }
.mt-f-hint { margin: 8px 2px 0; font-size: 12px; color: var(--f-faint); }
#mt-when-hint { color: var(--f-muted); }
.mt-f-conflict {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
    padding: 7px 10px;
    font-size: 12.5px;
    color: #fcd9a0;
    background: rgba(245, 185, 74, 0.12);
    border: 1px solid rgba(245, 185, 74, 0.35);
    border-radius: 10px;
}

/* Participants */
.mt-people-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 6px 8px;
    background: #121317;
    border: 1px solid var(--f-line);
    border-radius: 10px;
    cursor: text;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mt-people-input:focus-within { border-color: var(--f-accent); box-shadow: 0 0 0 3px rgba(122, 167, 255, 0.22); }
.mt-people-chips { display: contents; }
.mt-pchip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px 2px 3px;
    font-size: 12.5px;
    color: #eceef2;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}
.mt-pchip button {
    width: 18px;
    height: 18px;
    line-height: 1;
    font-size: 15px;
    color: var(--f-muted);
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}
.mt-pchip button:hover { color: #fff; background: rgba(255, 255, 255, 0.16); }
.mt-pchip b, .mt-suggest b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 9.5px;
    font-weight: 700;
    color: #0b1220;
    background: hsl(var(--h), 70%, 72%);
    border-radius: 50%;
}
#modal-content .mt-people-input input {
    flex: 1;
    min-width: 110px;
    height: 26px;
    padding: 0 4px;
    font-size: 13.5px;
    color: #eceef2;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none;
}
.mt-f-block { position: relative; }
.mt-suggest {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 30;
    margin-top: 6px;
    padding: 4px;
    background: #1d1e22;
    border: 1px solid var(--f-line);
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}
.mt-suggest button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    color: #eceef2;
    text-align: left;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.mt-suggest button:hover, .mt-suggest button.is-on { background: rgba(122, 167, 255, 0.16); }

/* Notes */
.mt-f-notes-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.mt-f-notes-head h3 { margin: 0 !important; }
.mt-f-notes-head .mt-f-chips { margin: 0; }
.mt-form #codemirror-editor { border-radius: 12px; overflow: hidden; border: 1px solid var(--f-line); transition: border-color 0.15s ease; }
.mt-form #codemirror-editor:focus-within { border-color: var(--f-accent); }
#modal-content .mt-form #codemirror-editor .CodeMirror,
#modal-content .mt-form #codemirror-editor .CodeMirror-gutters,
#modal-content .mt-form #codemirror-editor .preview-overlay { background-color: #121317 !important; border: none !important; }
.mt-form .CodeMirror { height: 340px !important; font-size: 14px; line-height: 1.65; }
.mt-form .CodeMirror-scroll { padding: 12px 14px; }
.mt-form .preview-overlay { border-radius: 0; padding: 14px 18px; }

/* Pied */
.mt-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px 18px; border-top: 1px solid var(--f-line); }
.mt-form-actions { display: flex; align-items: center; gap: 10px; }
.mt-f-shortcut { display: inline-flex; gap: 3px; margin-right: 4px; opacity: 0.8; }
.mt-form-delete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: #fca5a5;
    background: transparent;
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.mt-form-delete:hover { background: rgba(220, 53, 69, 0.14); }
.mt-form-delete.is-armed { color: #fff; background: #c0392b; border-color: #c0392b; }

@media (max-width: 820px) {
    .mt-f-grid { grid-template-columns: 1fr; }
    .mt-f-side { border-right: none; border-bottom: 1px solid var(--f-line); padding: 18px 20px; }
    .mt-f-notes { padding: 18px 20px; }
    .mt-f-head, .mt-form-foot { padding-left: 20px; padding-right: 20px; }
    .mt-f-shortcut { display: none; }
}

/* ---------- notes : éditeur de blocs (le même que la description des tâches) ---------- */
.mt-form .mt-desc { min-height: 240px; max-height: 52vh; overflow: auto; padding: 12px 18px 22px; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--f-line); border-radius: 12px; transition: border-color 0.15s ease; }
.mt-form .mt-desc:focus-within { border-color: var(--f-accent); }
