/* CœursConnect — messagerie interne plateforme/admin. Styles strictement préfixés. */
.platform-inbox-shortcut {
    position: relative;
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #ebe5ea;
    border-radius: 14px;
    color: #5e5661;
    background: rgba(255,255,255,.9);
    text-decoration: none;
    transition: .18s ease;
}
.platform-inbox-shortcut:hover { color: #e84470; border-color: #f1cbd6; background: #fff5f8; transform: translateY(-1px); }
.platform-inbox-shortcut svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.platform-inbox-badge,
.admin-support-nav-badge,
.admin-support-top-badge,
.mobile-support-badge,
.menu-support-badge {
    display: inline-grid;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg,#fa557f,#df3766);
    box-shadow: 0 5px 12px rgba(226,57,101,.22);
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
}
.platform-inbox-badge { position: absolute; top: -6px; right: -6px; border: 2px solid #fff; }
.menu-support-badge { margin-left: auto; }
.mobile-support-badge { margin-left: auto; }

.support-mailbox-page,
.support-thread-page {
    --support-bg: #faf8fa;
    --support-panel: #fff;
    --support-ink: #211b25;
    --support-muted: #807681;
    --support-line: #ece6eb;
    --support-primary: #ed4b75;
    --support-primary-dark: #d93e67;
    --support-soft: #fff1f5;
    background:
        radial-gradient(circle at 10% 4%, rgba(255,213,226,.36), transparent 26rem),
        radial-gradient(circle at 94% 10%, rgba(225,230,255,.32), transparent 28rem),
        var(--support-bg);
}
.support-shell { width: min(calc(100% - 48px), 1240px); margin: 0 auto; padding: 34px 0 76px; }
.support-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 27px 30px;
    margin-bottom: 18px;
    border: 1px solid rgba(237,230,235,.98);
    border-radius: 24px;
    background: linear-gradient(135deg,rgba(255,255,255,.98),rgba(255,246,249,.92));
    box-shadow: 0 18px 46px rgba(48,32,44,.055);
}
.support-eyebrow,
.admin-kicker { color: var(--support-primary,#ed4b75); font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.support-hero h1,
.admin-support-heading h1 { margin: 6px 0 6px; color: var(--support-ink,#211b25); font-size: clamp(28px,3vw,38px); line-height: 1.08; letter-spacing: -.04em; }
.support-hero p,
.admin-support-heading p { margin: 0; max-width: 720px; color: var(--support-muted,#807681); font-size: 13px; line-height: 1.55; }
.support-panel,
.support-thread-card {
    border: 1px solid var(--support-line,#ece6eb);
    border-radius: 22px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 18px 48px rgba(45,31,42,.055);
    overflow: hidden;
}
.support-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 19px 21px;
    border-bottom: 1px solid var(--support-line,#ece6eb);
}
.support-panel-head > div { display:flex; align-items:center; gap:11px; }
.support-panel-icon { display:grid; width:38px; height:38px; place-items:center; border-radius:12px; color:#df426d; background:#fff0f4; }
.support-panel-head h2 { margin:0; color:var(--support-ink,#211b25); font-size:18px; }
.support-panel-head p { margin:3px 0 0; color:var(--support-muted,#807681); font-size:11px; }
.support-search { display:flex; min-width:min(100%,330px); align-items:center; gap:8px; min-height:42px; padding:0 12px; border:1px solid #e9e2e8; border-radius:13px; background:#fff; }
.support-search > span { color:#8c8290; font-size:15px; }
.support-search input { width:100%; min-width:0; border:0; outline:0; color:#29212d; background:transparent; font:inherit; font-size:12px; }
.support-search > a { display:grid; width:25px; height:25px; place-items:center; border-radius:50%; color:#8c8290; text-decoration:none; }
.support-table-wrap { overflow-x:auto; }
.support-table { width:100%; border-collapse:collapse; color:#2c2530; font-size:12px; }
.support-table th { padding:13px 14px; border-bottom:1px solid #ebe5ea; color:#918695; font-size:9px; font-weight:850; letter-spacing:.045em; text-align:left; text-transform:uppercase; white-space:nowrap; }
.support-table td { padding:14px; border-bottom:1px solid #f0ebef; vertical-align:middle; }
.support-table tbody tr:last-child td { border-bottom:0; }
.support-table tbody tr { transition: background .15s ease; }
.support-table tbody tr:hover { background:#fffbfc; }
.support-table tbody tr.is-unread { background:linear-gradient(90deg,#fff5f8,#fff); }
.support-table td > strong { display:block; color:#241d27; font-size:12px; }
.support-table td > small { display:block; margin-top:3px; color:#948b96; font-size:10px; }
.support-preview { display:block; max-width:360px; color:#716873; line-height:1.5; }
.support-table-action { width:1%; white-space:nowrap; text-align:right; }
.support-status { display:inline-flex; min-height:25px; align-items:center; gap:6px; padding:5px 9px; border-radius:999px; font-size:9.5px; font-weight:800; white-space:nowrap; }
.support-status i { width:6px; height:6px; border-radius:50%; background:currentColor; box-shadow:0 0 0 4px rgba(229,65,107,.1); }
.support-status-new { color:#d83d65; background:#fff0f4; }
.support-status-answered { color:#198462; background:#eaf9f3; }
.support-status-sent { color:#756c79; background:#f3f1f4; }
.support-btn { display:inline-flex; min-height:40px; align-items:center; justify-content:center; gap:8px; padding:9px 14px; border:1px solid transparent; border-radius:12px; font-size:11px; font-weight:800; line-height:1; text-decoration:none; cursor:pointer; transition:.16s ease; }
.support-btn:hover { transform:translateY(-1px); }
.support-btn svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.support-btn-primary { color:#fff; background:linear-gradient(135deg,#f15b82,#df416c); box-shadow:0 9px 22px rgba(223,65,108,.18); }
.support-btn-primary:hover { color:#fff; box-shadow:0 12px 25px rgba(223,65,108,.24); }
.support-btn-soft { color:#d9436b; border-color:#f0ced8; background:#fff7f9; }
.support-btn-ghost { color:#655d68; border-color:#e8e1e7; background:#fff; }
.support-pagination { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px; border-top:1px solid #eee8ed; color:#8a808d; font-size:10px; }
.support-pagination nav { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.support-pagination nav a { display:grid; min-width:31px; height:31px; padding:0 9px; place-items:center; border:1px solid #ebe4e9; border-radius:9px; color:#5e5662; background:#fff; text-decoration:none; font-weight:750; }
.support-pagination nav a.active { color:#fff; border-color:#e64670; background:#e94a74; }
.support-pagination nav span { padding:0 3px; }
.support-empty { display:grid; min-height:240px; place-items:center; align-content:center; gap:7px; text-align:center; }
.support-empty > span { display:grid; width:52px; height:52px; place-items:center; border-radius:17px; color:#e54570; background:#fff0f4; font-size:22px; }
.support-empty h3 { margin:5px 0 0; font-size:17px; }
.support-empty p { margin:0 0 9px; color:#837985; }

/* Thread membre */
.support-thread-shell { width:min(calc(100% - 48px),940px); }
.support-thread-card { display:flex; min-height:650px; flex-direction:column; }
.support-thread-head { display:grid; grid-template-columns:auto auto minmax(0,1fr) auto; align-items:center; gap:13px; padding:17px 19px; border-bottom:1px solid #eee8ed; background:rgba(255,255,255,.97); }
.support-back { display:grid; width:36px; height:36px; place-items:center; border:1px solid #ebe4e9; border-radius:11px; color:#5e5662; text-decoration:none; }
.support-team-avatar { position:relative; display:grid; width:43px; height:43px; place-items:center; border-radius:14px; color:#fff; background:linear-gradient(145deg,#f45e84,#df3c68); box-shadow:0 8px 18px rgba(221,55,100,.22); }
.support-team-avatar i { position:absolute; right:-2px; bottom:-2px; width:11px; height:11px; border:2px solid #fff; border-radius:50%; background:#23b783; }
.support-thread-title span { color:#e54570; font-size:8.5px; font-weight:850; letter-spacing:.1em; }
.support-thread-title h1 { margin:2px 0 1px; color:#241d27; font-size:17px; line-height:1.2; }
.support-thread-title p { margin:0; color:#938996; font-size:10px; }
.support-secure-pill { padding:7px 10px; border-radius:999px; color:#27836b; background:#edf9f5; font-size:9px; font-weight:750; white-space:nowrap; }
.support-conversation { flex:1; padding:22px 22px 28px; background:linear-gradient(180deg,#fff,#fdfbfc); }
.support-day { display:flex; align-items:center; gap:12px; margin:8px 0 19px; color:#9b929e; font-size:9px; }
.support-day::before,.support-day::after { content:""; height:1px; flex:1; background:#eee8ed; }
.support-day span { padding:5px 9px; border:1px solid #eee8ed; border-radius:999px; background:#fff; }
.support-bubble-row { display:flex; align-items:flex-end; gap:8px; margin:0 0 16px; }
.support-bubble-row.is-member { justify-content:flex-end; }
.support-bubble-row.is-member .support-bubble-wrap { align-items:flex-end; }
.support-bubble-row.is-member .support-bubble { color:#fff; background:linear-gradient(135deg,#f25a81,#e2426c); border-bottom-right-radius:5px; }
.support-bubble-row.is-admin .support-bubble { color:#342c37; background:#f3f0f3; border-bottom-left-radius:5px; }
.support-mini-avatar { display:grid; width:31px; height:31px; flex:none; place-items:center; border-radius:10px; font-size:12px; }
.support-mini-avatar.admin { color:#fff; background:linear-gradient(145deg,#f35a80,#df3f69); }
.support-mini-avatar.guest { color:#6f6672; background:#eee9ed; }
.support-bubble-wrap { display:flex; max-width:min(72%,610px); flex-direction:column; gap:4px; }
.support-message-meta { display:flex; align-items:center; gap:7px; padding:0 3px; color:#948b97; font-size:9px; }
.support-message-meta strong { color:#5a515d; font-size:9.5px; }
.support-bubble { padding:10px 13px; border-radius:15px; font-size:12.5px; line-height:1.55; box-shadow:0 5px 14px rgba(48,34,45,.035); word-break:break-word; }
.support-read-state { color:#9a919d; font-size:8.5px; }
.support-composer { padding:15px 18px 17px; border-top:1px solid #eee8ed; background:#fff; }
.support-composer > label { display:block; margin:0 0 7px; color:#4c444f; font-size:10px; font-weight:800; }
.support-composer > div:last-of-type,.support-composer > div:not(.support-composer-label) { display:flex; align-items:flex-end; gap:9px; }
.support-composer textarea { width:100%; min-height:72px; max-height:180px; resize:vertical; padding:12px 13px; border:1px solid #e6dfe5; border-radius:14px; outline:none; color:#2e2731; background:#faf8fa; font:inherit; font-size:12px; line-height:1.45; }
.support-composer textarea:focus { border-color:#eca7ba; background:#fff; box-shadow:0 0 0 4px rgba(238,77,119,.07); }
.support-send { display:inline-flex; min-height:44px; flex:none; align-items:center; gap:7px; padding:0 15px; border:0; border-radius:13px; color:#fff; background:linear-gradient(135deg,#f25b82,#df416c); box-shadow:0 8px 20px rgba(223,65,108,.18); font-size:11px; font-weight:800; cursor:pointer; }
.support-composer > small { display:block; margin-top:7px; color:#9a919d; font-size:8.5px; }

/* Administration */
.admin-support-page { --support-ink:#161322; --support-muted:#807887; --support-line:#e4e6ec; --support-primary:#f04470; }
.admin-support-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; margin:4px 0 23px; }
.admin-support-heading h1 { font-size:31px; }
.admin-support-kpis { display:flex; gap:8px; }
.admin-support-kpis span { min-width:128px; padding:10px 12px; border:1px solid #e4e6ed; border-radius:12px; color:#787180; background:#fff; font-size:9px; }
.admin-support-kpis b { display:block; margin-bottom:2px; color:#191522; font-size:18px; }
.admin-support-kpis .is-unread { color:#c23d60; border-color:#f2d2db; background:#fff6f8; }
.admin-support-panel { border-radius:20px; box-shadow:0 16px 42px rgba(28,32,44,.045); }
.admin-support-filters { display:flex; align-items:center; gap:9px; padding:16px 18px; border-bottom:1px solid #e9eaf0; }
.admin-support-filters .support-search { flex:1; max-width:430px; }
.admin-support-filters select { min-height:42px; padding:0 34px 0 12px; border:1px solid #e3e5eb; border-radius:12px; color:#393541; background:#fff; font-size:11px; }
.admin-support-table .admin-support-member { display:flex; align-items:center; gap:9px; min-width:180px; }
.admin-support-member > span:last-child { display:grid; gap:2px; }
.admin-support-member strong { color:#211c27; font-size:11px; }
.admin-support-member small { color:#8b8490; font-size:9px; }
.support-guest-avatar { display:grid; width:34px; height:34px; flex:none; place-items:center; border-radius:50%; color:#827987; background:#eeeaf0; font-weight:800; }
.admin-support-nav-badge { margin-left:auto; min-width:18px; height:18px; font-size:8px; }
.admin-support-top-badge { position:absolute; right:-5px; top:-5px; border:2px solid #fff; }
.admin-support-notification-link { position:relative; }
.admin-support-thread-heading { align-items:center; }
.admin-support-back { display:inline-flex; margin-bottom:10px; color:#756e7b; font-size:10px; font-weight:750; text-decoration:none; }
.admin-support-thread-card { border-radius:20px; }
.admin-support-conversation { min-height:490px; }
.admin-support-conversation .support-bubble-row.is-member-request { justify-content:flex-start; }
.admin-support-conversation .support-bubble-row.is-admin-reply { justify-content:flex-end; }
.admin-support-conversation .support-bubble-row.is-admin-reply .support-bubble-wrap { align-items:flex-end; }
.admin-support-conversation .is-member-request .support-bubble { color:#332d38; background:#f1f3f7; border-bottom-left-radius:5px; }
.admin-support-conversation .is-admin-reply .support-bubble { color:#fff; background:linear-gradient(135deg,#f15a80,#df406a); border-bottom-right-radius:5px; }
.admin-support-composer { padding:18px; }
.support-composer-label { margin:0 0 11px; }
.support-composer-label > div { display:flex; align-items:center; gap:9px; }
.support-composer-label > div > span { display:grid; width:34px; height:34px; place-items:center; border-radius:11px; color:#e44770; background:#fff0f4; }
.support-composer-label strong { display:block; color:#2a2430; font-size:12px; }
.support-composer-label small { color:#8d8590; font-size:9px; }

/* Contact : accès rapide à la boîte interne */
.contact-internal-mailbox { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:16px; padding:13px 14px; border:1px solid #f0d6de; border-radius:14px; background:#fff7f9; }
.contact-internal-mailbox div { display:grid; gap:2px; }
.contact-internal-mailbox strong { color:#392f3b; font-size:12px; }
.contact-internal-mailbox small { color:#897d8a; font-size:9.5px; }

/* Sombre */
html[data-theme="dark"] .support-mailbox-page,
html[data-theme="dark"] .support-thread-page,
body.dark .support-mailbox-page,
body.dark .support-thread-page { --support-bg:#15121a; --support-panel:#1d1922; --support-ink:#f8f4f8; --support-muted:#aaa1ad; --support-line:#302a34; }
html[data-theme="dark"] .support-hero,
html[data-theme="dark"] .support-panel,
html[data-theme="dark"] .support-thread-card { background:#1d1922; border-color:#312a35; }
html[data-theme="dark"] .support-search,
html[data-theme="dark"] .support-pagination nav a,
html[data-theme="dark"] .support-day span,
html[data-theme="dark"] .support-thread-head,
html[data-theme="dark"] .support-composer { background:#211c26; border-color:#37303b; }
html[data-theme="dark"] .support-search input,
html[data-theme="dark"] .support-thread-title h1,
html[data-theme="dark"] .support-table td > strong,
html[data-theme="dark"] .support-panel-head h2 { color:#f7f2f7; }
html[data-theme="dark"] .support-table th,
html[data-theme="dark"] .support-table td,
html[data-theme="dark"] .support-panel-head { border-color:#312b35; }
html[data-theme="dark"] .support-table tbody tr:hover,
html[data-theme="dark"] .support-table tbody tr.is-unread { background:#241d27; }
html[data-theme="dark"] .support-bubble-row.is-admin .support-bubble { color:#eee8ef; background:#2b2530; }
html[data-theme="dark"] .support-conversation { background:#18151c; }
html[data-theme="dark"] .support-composer textarea { color:#f5eef5; background:#242029; border-color:#3a323e; }

@media (max-width: 860px) {
    .support-shell,.support-thread-shell { width:min(calc(100% - 28px),860px); padding-top:18px; }
    .support-hero { align-items:flex-start; flex-direction:column; padding:21px; }
    .support-panel-head { align-items:stretch; flex-direction:column; }
    .support-search { max-width:none; width:100%; }
    .admin-support-heading { align-items:flex-start; flex-direction:column; }
    .admin-support-kpis { width:100%; }
    .admin-support-kpis span { flex:1; }
    .admin-support-filters { align-items:stretch; flex-wrap:wrap; }
    .admin-support-filters .support-search { max-width:none; flex-basis:100%; }
    .support-thread-head { grid-template-columns:auto auto minmax(0,1fr); }
    .support-secure-pill { grid-column:2 / -1; justify-self:start; }
}

@media (max-width: 680px) {
    .platform-inbox-shortcut { width:38px; height:38px; border-radius:12px; }
    .support-shell,.support-thread-shell { width:min(calc(100% - 18px),680px); padding:10px 0 88px; }
    .support-hero { padding:18px 16px; border-radius:18px; }
    .support-hero h1 { font-size:27px; }
    .support-hero .support-btn { width:100%; }
    .support-panel,.support-thread-card { border-radius:17px; }
    .support-table { display:block; }
    .support-table thead { display:none; }
    .support-table tbody { display:grid; }
    .support-table tr { display:grid; grid-template-columns:1fr auto; gap:8px 12px; padding:14px; border-bottom:1px solid #eee8ed; }
    .support-table td { display:block; padding:0; border:0; }
    .support-table td::before { content:attr(data-label); display:block; margin-bottom:3px; color:#9a909c; font-size:8px; font-weight:800; text-transform:uppercase; }
    .support-table td:nth-child(2), .support-table td:nth-child(3) { grid-column:1 / -1; }
    .admin-support-table td:nth-child(2), .admin-support-table td:nth-child(3), .admin-support-table td:nth-child(4) { grid-column:1 / -1; }
    .support-table-action { grid-column:2; grid-row:1; }
    .support-preview { max-width:none; }
    .support-pagination { align-items:flex-start; flex-direction:column; }
    .support-pagination nav { width:100%; overflow-x:auto; flex-wrap:nowrap; padding-bottom:3px; }
    .support-thread-head { grid-template-columns:auto auto minmax(0,1fr); padding:14px 12px; }
    .support-back { width:32px; height:32px; }
    .support-team-avatar { width:38px; height:38px; }
    .support-thread-title h1 { font-size:14px; }
    .support-secure-pill { display:none; }
    .support-conversation { padding:17px 12px 21px; }
    .support-bubble-wrap { max-width:84%; }
    .support-bubble { font-size:13.5px; }
    .support-composer { padding:12px; }
    .support-composer > div:not(.support-composer-label) { align-items:stretch; flex-direction:column; }
    .support-send { justify-content:center; width:100%; }
    .admin-support-kpis { display:grid; grid-template-columns:1fr 1fr; }
    .admin-support-filters select,.admin-support-filters .support-btn { flex:1; }
}
.admin-support-notification-link { display:grid!important; width:38px!important; height:38px!important; place-items:center!important; border:1px solid #e1e6ee!important; border-radius:11px!important; color:#647187!important; background:#fff!important; text-decoration:none!important; font-size:13px!important; }
.admin-support-notification-link:hover { color:#e4436f!important; border-color:#efb8c8!important; background:#fff7f9!important; }
.support-channel{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border-radius:999px;background:#f3f0f4;color:#756b78;font-size:9px;font-weight:780;white-space:nowrap}
.user-menu-panel .menu-support-badge,.premium-account-panel .menu-support-badge{display:inline-grid;margin-left:7px;vertical-align:middle}
.app-mobile-drawer-nav .mobile-support-badge{margin-left:7px;vertical-align:middle;font-style:normal}
.admin-pro-shell.is-sidebar-collapsed .admin-support-nav-badge{display:none}
