/* Assistant Webiclub — floating panel available on every dashboard section. */

.webisport-dashboard .wsa-root {
    --wsa-width: 420px;
    font-size: 14px;
    line-height: 1.5;
}

/* Launcher */
.webisport-dashboard .wsa-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--ws-primary, #7367f0);
    color: var(--ws-on-primary, #fff);
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 6px 20px var(--ws-primary-shadow-md, rgba(115, 103, 240, 0.35));
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.webisport-dashboard .wsa-launcher:hover { transform: translateY(-2px); }
.webisport-dashboard .wsa-launcher:focus-visible { outline: 3px solid var(--ws-primary-soft, rgba(115, 103, 240, 0.3)); outline-offset: 2px; }
.webisport-dashboard .wsa-launcher-icon { font-size: 16px; }
.webisport-dashboard .wsa-root[data-open="true"] .wsa-launcher { display: none; }
/* Keep room under the page content so the fixed launcher never covers the
   last controls (table pagination, form buttons) once scrolled to the bottom. */
.webisport-dashboard:has(> .wsa-root) .webisport-dashboard-main { padding-bottom: calc(24px + 48px + 1.5rem); }

/* Panel */
.webisport-dashboard .wsa-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9991;
    width: var(--wsa-width);
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    background: var(--ws-white, #fff);
    border-left: 1px solid var(--ws-gray-200, #e6e6e8);
    box-shadow: -8px 0 30px rgba(47, 51, 73, 0.12);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0.22s;
}
.webisport-dashboard .wsa-root[data-open="true"] .wsa-panel { transform: translateX(0); visibility: visible; }

@media (min-width: 1280px) {
    .webisport-dashboard.wsa-panel-open .webisport-dashboard-main { margin-right: 420px; transition: margin-right 0.22s ease; }
}
@media (max-width: 782px) {
    .webisport-dashboard .wsa-root { --wsa-width: 100vw; }
    .webisport-dashboard .wsa-launcher { right: 16px; bottom: 16px; padding: 12px; }
    .webisport-dashboard .wsa-launcher-label { display: none; }
    .webisport-dashboard:has(> .wsa-root) .webisport-dashboard-main { padding-bottom: calc(16px + 48px + 1rem); }
}

.webisport-dashboard .wsa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ws-gray-200, #e6e6e8);
}
.webisport-dashboard .wsa-title { font-weight: 700; font-size: 16px; color: var(--ws-gray-900, #2f2b3d); }
.webisport-dashboard .wsa-title-icon { color: var(--ws-primary, #7367f0); }
.webisport-dashboard .wsa-header-actions { display: flex; gap: 4px; }
.webisport-dashboard .wsa-icon-btn {
    width: 34px; height: 34px;
    border: 0; border-radius: 8px;
    background: transparent;
    color: var(--ws-gray-600, #6d6b77);
    font-size: 16px;
    cursor: pointer;
}
.webisport-dashboard .wsa-icon-btn:hover { background: var(--ws-gray-50, #f8f7fa); color: var(--ws-primary, #7367f0); }

.webisport-dashboard .wsa-body,
.webisport-dashboard .wsa-history {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--ws-gray-50, #f8f7fa);
}
.webisport-dashboard .wsa-body[hidden], .webisport-dashboard .wsa-history[hidden] { display: none; }

/* Messages */
.webisport-dashboard .wsa-msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; word-wrap: break-word; }
.webisport-dashboard .wsa-msg p { margin: 0 0 6px; }
.webisport-dashboard .wsa-msg p:last-child { margin-bottom: 0; }
.webisport-dashboard .wsa-msg ul, .webisport-dashboard .wsa-msg ol { margin: 4px 0 6px 18px; padding: 0; }
.webisport-dashboard .wsa-msg-user {
    align-self: flex-end;
    background: var(--ws-primary, #7367f0);
    color: var(--ws-on-primary, #fff);
    border-bottom-right-radius: 4px;
}
.webisport-dashboard .wsa-msg-assistant {
    align-self: flex-start;
    background: var(--ws-white, #fff);
    color: var(--ws-gray-900, #2f2b3d);
    border: 1px solid var(--ws-gray-200, #e6e6e8);
    border-bottom-left-radius: 4px;
}
.webisport-dashboard .wsa-msg a { color: inherit; text-decoration: underline; }

.webisport-dashboard .wsa-welcome { padding: 8px 4px; color: var(--ws-gray-700, #444050); }
.webisport-dashboard .wsa-hello { font-size: 18px; font-weight: 700; margin: 0 0 6px; color: var(--ws-gray-900, #2f2b3d); }
.webisport-dashboard .wsa-chips { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.webisport-dashboard .wsa-chip {
    text-align: left;
    padding: 10px 14px;
    border: 1px solid var(--ws-primary-border-soft, rgba(115, 103, 240, 0.22));
    border-radius: 12px;
    background: var(--ws-white, #fff);
    color: var(--ws-primary-ink, #7367f0);
    font-weight: 500;
    cursor: pointer;
}
.webisport-dashboard .wsa-chip:hover { background: var(--ws-primary-alpha-16, rgba(115, 103, 240, 0.08)); }

/* Progress & typing */
.webisport-dashboard .wsa-progress { font-size: 13px; color: var(--ws-gray-600, #6d6b77); }
.webisport-dashboard .wsa-progress ul { list-style: none; margin: 0; padding: 0; }
.webisport-dashboard .wsa-progress li { padding: 2px 0 2px 22px; position: relative; }
.webisport-dashboard .wsa-progress li::before { content: '•'; position: absolute; left: 6px; color: var(--ws-primary, #7367f0); }
.webisport-dashboard .wsa-progress li.is-done::before,
.webisport-dashboard .wsa-progress.is-done li::before { content: '✓'; color: var(--ws-success, #28c76f); left: 4px; }
.webisport-dashboard .wsa-progress.is-live li:last-child:not(.is-done)::before { animation: wsa-pulse 1s infinite; }

.webisport-dashboard .wsa-typing { display: inline-flex; gap: 4px; padding: 10px 14px; background: var(--ws-white, #fff); border: 1px solid var(--ws-gray-200, #e6e6e8); border-radius: 14px; }
.webisport-dashboard .wsa-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ws-gray-400, #acaab1); animation: wsa-bounce 1.2s infinite; }
.webisport-dashboard .wsa-typing span:nth-child(2) { animation-delay: 0.15s; }
.webisport-dashboard .wsa-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes wsa-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes wsa-pulse { 50% { opacity: 0.2; } }

/* Cards */
.webisport-dashboard .wsa-cards { display: flex; flex-direction: column; gap: 10px; }
.webisport-dashboard .wsa-card {
    background: var(--ws-white, #fff);
    border: 1px solid var(--ws-gray-200, #e6e6e8);
    border-left: 4px solid var(--ws-info, #00bad1);
    border-radius: 10px;
    padding: 12px 14px;
}
.webisport-dashboard .wsa-card--a_corriger { border-left-color: var(--ws-warning, #ff9f43); }
.webisport-dashboard .wsa-card--action_parent { border-left-color: var(--ws-primary, #7367f0); }
.webisport-dashboard .wsa-card--support { border-left-color: var(--ws-danger, #ff4c51); }
.webisport-dashboard .wsa-card--ok, .webisport-dashboard .wsa-card--normal { border-left-color: var(--ws-success, #28c76f); }
.webisport-dashboard .wsa-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.webisport-dashboard .wsa-card-title { font-weight: 700; color: var(--ws-gray-900, #2f2b3d); }
.webisport-dashboard .wsa-card-text p { margin: 0 0 6px; }
.webisport-dashboard .wsa-card-text p:last-child { margin: 0; }
.webisport-dashboard .wsa-card-foot { margin-top: 8px; }

.webisport-dashboard .wsa-badge { flex-shrink: 0; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--ws-info-light, rgba(0, 186, 209, 0.16)); color: var(--ws-info-dark, #0097aa); white-space: nowrap; }
.webisport-dashboard .wsa-badge--a_corriger { background: var(--ws-warning-light, rgba(255, 159, 67, 0.16)); color: var(--ws-warning-dark, #d97706); }
.webisport-dashboard .wsa-badge--action_parent { background: var(--ws-primary-alpha-16, rgba(115, 103, 240, 0.16)); color: var(--ws-primary-ink, #7367f0); }
.webisport-dashboard .wsa-badge--support { background: var(--ws-danger-light, rgba(255, 76, 81, 0.16)); color: var(--ws-danger-dark, #e6353b); }
.webisport-dashboard .wsa-badge--ok, .webisport-dashboard .wsa-badge--normal { background: var(--ws-success-light, rgba(40, 199, 111, 0.16)); color: var(--ws-success-dark, #1f9b56); }

.webisport-dashboard .wsa-parent-msg { margin-top: 10px; padding: 10px; border-radius: 8px; background: var(--ws-gray-50, #f8f7fa); border: 1px dashed var(--ws-gray-300, #dbdade); }
.webisport-dashboard .wsa-parent-msg-label { font-size: 12px; font-weight: 600; color: var(--ws-gray-600, #6d6b77); margin-bottom: 4px; }
.webisport-dashboard .wsa-parent-msg-text { margin-bottom: 8px; }

/* Actions */
.webisport-dashboard .wsa-action { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--ws-primary-alpha-16, rgba(115, 103, 240, 0.08)); }
.webisport-dashboard .wsa-action--standalone { margin-top: 0; background: var(--ws-white, #fff); border: 1px solid var(--ws-primary-border-soft, rgba(115, 103, 240, 0.3)); }
.webisport-dashboard .wsa-action.is-executed { background: var(--ws-success-light, rgba(40, 199, 111, 0.12)); }
.webisport-dashboard .wsa-action.is-failed { background: var(--ws-danger-light, rgba(255, 76, 81, 0.12)); }
.webisport-dashboard .wsa-action.is-cancelled, .webisport-dashboard .wsa-action.is-undone { background: var(--ws-gray-50, #f8f7fa); color: var(--ws-gray-600, #6d6b77); }
.webisport-dashboard .wsa-action-title { font-weight: 600; margin-bottom: 6px; }
.webisport-dashboard .wsa-action-preview { margin: 0 0 8px; font-size: 13px; }
.webisport-dashboard .wsa-action-preview dt { font-weight: 600; color: var(--ws-gray-700, #444050); margin-top: 4px; }
.webisport-dashboard .wsa-action-preview dd { margin: 0; }
.webisport-dashboard .wsa-action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.webisport-dashboard .wsa-action-comment { width: 100%; margin-bottom: 8px; border: 1px solid var(--ws-gray-300, #dbdade); border-radius: 8px; padding: 6px 8px; font: inherit; resize: vertical; }
.webisport-dashboard .wsa-action-status { font-weight: 600; }
.webisport-dashboard .wsa-confirm-all { display: flex; justify-content: center; }

/* Buttons */
.webisport-dashboard .wsa-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 13px; cursor: pointer; }
.webisport-dashboard .wsa-btn-primary { background: var(--ws-primary, #7367f0); color: var(--ws-on-primary, #fff); }
.webisport-dashboard .wsa-btn-primary:hover { background: var(--ws-primary-dark, #685dd8); }
.webisport-dashboard .wsa-btn-light { background: var(--ws-white, #fff); color: var(--ws-gray-700, #444050); border-color: var(--ws-gray-300, #dbdade); }
.webisport-dashboard .wsa-btn-light:hover { border-color: var(--ws-primary, #7367f0); color: var(--ws-primary, #7367f0); }
.webisport-dashboard .wsa-btn:disabled { opacity: 0.6; cursor: default; }
.webisport-dashboard .wsa-btn.is-loading::after { content: ''; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: wsa-spin 0.7s linear infinite; }
@keyframes wsa-spin { to { transform: rotate(360deg); } }
.webisport-dashboard .wsa-link { border: 0; background: none; padding: 0; color: var(--ws-primary-ink, #7367f0); font-weight: 600; cursor: pointer; font-size: 13px; }
.webisport-dashboard .wsa-link:hover { text-decoration: underline; }

/* Guide */
.webisport-dashboard .wsa-guide { background: var(--ws-white, #fff); border: 1px solid var(--ws-gray-200, #e6e6e8); border-radius: 10px; padding: 12px 14px; }
.webisport-dashboard .wsa-guide-title { font-weight: 700; margin-bottom: 4px; }
.webisport-dashboard .wsa-guide ol { margin: 0 0 10px 18px; padding: 0; }
.webisport-dashboard .wsa-highlight { outline: 3px solid var(--ws-warning, #ff9f43) !important; outline-offset: 3px; border-radius: 6px; animation: wsa-glow 1.2s ease-in-out 4; }
@keyframes wsa-glow { 50% { outline-color: transparent; } }

/* Footer */
.webisport-dashboard .wsa-footer { padding: 12px 16px 10px; border-top: 1px solid var(--ws-gray-200, #e6e6e8); background: var(--ws-white, #fff); }
.webisport-dashboard .wsa-form { display: flex; align-items: flex-end; gap: 8px; }
.webisport-dashboard .wsa-input { flex: 1; resize: none; min-height: 42px; max-height: 140px; padding: 10px 12px; border: 1px solid var(--ws-gray-300, #dbdade); border-radius: 12px; font: inherit; }
.webisport-dashboard .wsa-input:focus { outline: none; border-color: var(--ws-primary, #7367f0); box-shadow: 0 0 0 3px var(--ws-primary-alpha-16, rgba(115, 103, 240, 0.16)); }
.webisport-dashboard .wsa-send { width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--ws-primary, #7367f0); color: var(--ws-on-primary, #fff); font-size: 16px; cursor: pointer; }
.webisport-dashboard .wsa-send:disabled { opacity: 0.5; cursor: default; }
.webisport-dashboard .wsa-disclaimer { margin-top: 6px; font-size: 11px; color: var(--ws-gray-500, #97959e); text-align: center; }

.webisport-dashboard .wsa-feedback { font-size: 12px; color: var(--ws-gray-600, #6d6b77); display: flex; align-items: center; gap: 6px; }
.webisport-dashboard .wsa-feedback button { border: 1px solid var(--ws-gray-300, #dbdade); background: var(--ws-white, #fff); border-radius: 8px; padding: 2px 8px; cursor: pointer; }
.webisport-dashboard .wsa-error { padding: 10px 14px; border-radius: 10px; background: var(--ws-danger-light, rgba(255, 76, 81, 0.12)); color: var(--ws-danger-dark, #e6353b); }

/* History */
.webisport-dashboard .wsa-history-title { font-weight: 700; margin: 4px 0; }
.webisport-dashboard .wsa-history-item { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 10px 12px; border: 1px solid var(--ws-gray-200, #e6e6e8); border-radius: 10px; background: var(--ws-white, #fff); cursor: pointer; }
.webisport-dashboard .wsa-history-item:hover { border-color: var(--ws-primary, #7367f0); }
.webisport-dashboard .wsa-history-item small, .webisport-dashboard .wsa-muted { color: var(--ws-gray-500, #97959e); }
.webisport-dashboard .wsa-ticket { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--ws-white, #fff); border-radius: 10px; border: 1px solid var(--ws-gray-200, #e6e6e8); }

/* Error toast button */
.webisport-dashboard .webisport-notification .wsa-why { margin-left: 10px; border: 1px solid currentColor; background: transparent; color: inherit; border-radius: 6px; padding: 1px 8px; font-weight: 600; cursor: pointer; }

/* Home insights */
.webisport-dashboard .webisport-assistant-insights { margin-bottom: 20px; }
.webisport-dashboard .wsa-insights { background: var(--ws-white, #fff); border: 1px solid var(--ws-primary-border-soft, rgba(115, 103, 240, 0.22)); border-radius: 12px; padding: 16px 18px; }
.webisport-dashboard .wsa-insights-head { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.webisport-dashboard .wsa-insights-head small { font-weight: 400; color: var(--ws-gray-500, #97959e); margin-left: 6px; }
.webisport-dashboard .wsa-insights ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.webisport-dashboard .wsa-insight { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border-left: 4px solid var(--ws-info, #00bad1); background: var(--ws-gray-50, #f8f7fa); }
.webisport-dashboard .wsa-insight p { margin: 2px 0 0; font-size: 13px; color: var(--ws-gray-600, #6d6b77); }
.webisport-dashboard .wsa-insight--attention { border-left-color: var(--ws-warning, #ff9f43); }
.webisport-dashboard .wsa-insight--critique { border-left-color: var(--ws-danger, #ff4c51); }
@media (max-width: 782px) {
    .webisport-dashboard .wsa-insight { flex-direction: column; align-items: flex-start; }
}
