/* /assets/css/style.css */

/* --- FONDATIONS ET STYLES GLOBAUX --- */
:root {
    --composer-height: 9rem;
    --prompt-max-height: 60vh;
}

body {
    /* Ancien: background-color: #f1f5f9; */
    background: linear-gradient(120deg, #f0f4f9 0%, #e6e9f2 100%);
    font-family: 'Inter', sans-serif;
    color: #374151; /* slate-700 */
}

/* --- INTERFACE CHATBOT (UX 2025) --- */
.chat-shell {
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

.chat-shell-inner {
    position: relative;
}

#chat-sidebar-backdrop {
    backdrop-filter: blur(4px);
}

.chat-sidebar {
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.chat-sidebar[data-collapsible="true"] {
    transition: width 0.25s ease, max-width 0.25s ease, transform 0.25s ease;
}

.chat-sidebar.collapsed {
    max-width: 84px;
    width: 84px;
    border-radius: 28px;
    overflow: visible;
}

.chat-sidebar.collapsed .chat-sidebar-header {
    border-bottom: none;
    justify-content: center;
}

.chat-sidebar.collapsed .chat-sidebar-title,
.chat-sidebar.collapsed .chat-sidebar-body,
.chat-sidebar.collapsed .conversation-actions,
.chat-sidebar.collapsed .conversation-link {
    display: none;
}

.chat-sidebar.collapsed .chat-sidebar-footer {
    border-top: none;
    padding: 0.5rem;
}

.chat-sidebar.collapsed .sidebar-primary-button {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    padding: 0;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-sidebar.collapsed .sidebar-primary-label {
    display: none;
}

.chat-sidebar.collapsed #collapse-sidebar-btn {
    transform: rotate(180deg);
}

@media (max-width: 1024px) {
    .chat-sidebar {
        position: fixed;
        inset: 48px 20px;
        display: flex;
        background: #ffffff;
        border-radius: 24px;
        box-shadow: 0 20px 40px -20px rgba(15, 23, 42, 0.35);
        overflow: hidden;
        z-index: 50;
    }
}

.sidebar-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    transition: all 0.2s ease;
}

.sidebar-icon-button:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.sidebar-primary-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    font-weight: 600;
    border-radius: 16px;
    padding: 12px 16px;
    border: none;
    box-shadow: 0 14px 30px -20px rgba(79, 70, 229, 0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px -18px rgba(79, 70, 229, 0.85);
}

.conversation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    transition: background 0.2s ease;
}

.conversation-item:hover {
    background: #f1f5f9;
}

.conversation-link {
    flex: 1;
    font-size: 0.95rem;
    text-decoration: none;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-link:hover {
    color: #4f46e5;
}

.conversation-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.conversation-item:hover .conversation-actions,
.conversation-item:focus-within .conversation-actions {
    opacity: 1;
}

.conversation-actions button,
.conversation-actions form button {
    border: none;
    background: #e2e8f0;
    border-radius: 10px;
    padding: 4px 6px;
    cursor: pointer;
    color: #475569;
}

.conversation-actions button:hover,
.conversation-actions form button:hover {
    background: #cbd5e1;
}

.chat-main {
    backdrop-filter: saturate(140%);
}

.chat-header {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 65%);
}

.model-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.conversation-title {
    font-size: 0.9rem;
    color: #475569;
    max-width: 26rem;
    white-space: nowrap;

.composer-ephemeral-button {
    padding: 10px 12px;
    gap: 0.65rem;
}

.composer-ephemeral-button svg {
    width: 1.4rem;
    height: 1.4rem;
}
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-compact-select {
    border-radius: 12px;
    border: 1px solid #d1d5db;
    padding: 8px 12px;
    font-size: 0.85rem;
    background: #ffffff;
    color: #374151;
    min-width: 12rem;
}

.header-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    color: #475569;
    background: #ffffff;
    transition: all 0.2s ease;
}

.header-icon-button:hover {
    color: #4f46e5;
    border-color: #c7d2fe;
}

.chat-controls {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.controls-pill {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 14px;
    background: #e0e7ff;
    color: #4338ca;
    font-weight: 600;
    border: none;
    transition: background 0.2s ease;
}

.controls-pill:hover {
    background: #c7d2fe;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #475569;
}

.form-select {
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.resume-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
    padding: 0.85rem 1.25rem;
    border-radius: 16px;
    width: calc(100% - 3rem);
}

.link-button {
    border: none;
    background: none;
    color: #1d4ed8;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
}

.link-button:hover {
    text-decoration: none;
}

.chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem clamp(1rem, 3vw, 2.25rem);
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.chat-thread-placeholder {
    align-self: center;
    color: #94a3b8;
    font-size: 1rem;
}


.chat-message {
    display: flex;
    align-items: flex-start;
    max-width: min(820px, 100%);
    position: relative;
}

.chat-message--assistant {
    align-self: flex-start;
}

.chat-message--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-bubble {
    position: relative;
    flex: 1;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.15rem 2.75rem 1.15rem 1.4rem;
    box-shadow: 0 8px 26px -20px rgba(15, 23, 42, 0.65);
    width: auto;
    max-width: min(820px, 100%);
}

.chat-message--assistant .chat-bubble {
    background: #f8fafc;
}

.chat-message--user .chat-bubble {
    background: linear-gradient(135deg, #312e81, #4338ca);
    color: #eef2ff;
    border: none;
    box-shadow: 0 18px 30px -18px rgba(67, 56, 202, 0.8);
    padding: 1.15rem 1.4rem 1.15rem 2.75rem;
}

.chat-message--user .message-content a {
    color: #bfdbfe;
}

.chat-message--user .message-content blockquote {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: rgba(219, 234, 254, 0.6);
    color: inherit;
}

.chat-message--user .message-content code {
    background: rgba(15, 23, 42, 0.35);
    color: #e0f2fe;
}


.chat-message-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-message--user .chat-message-actions {
    right: unset;
    left: 12px;
}

.chat-message:hover .chat-message-actions,
.chat-message:focus-within .chat-message-actions {
    opacity: 1;
}

.chat-message-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 0.75rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-message-actions button:hover {
    background: #e2e8f0;
}

.chat-message--user .chat-message-actions button {
    border: none;
    background: rgba(99, 102, 241, 0.2);
    color: #eef2ff;
}

.chat-message--user .chat-message-actions button:hover {
    background: rgba(79, 70, 229, 0.35);
}

.chat-composer {
    position: relative;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem clamp(1.25rem, 4vw, 2.5rem);
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.99) 100%);
    backdrop-filter: blur(8px);
    z-index: 5;
    box-shadow: inset 0 10px 24px -28px rgba(15, 23, 42, 0.55);
}

.composer-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
}

.composer-textarea {
    flex: 0 1 auto;
    resize: none;
    min-height: 52px;
    max-height: var(--prompt-max-height, 60vh);
    border-radius: 18px;
    border: 1px solid #d1d5db;
    padding: 14px 18px;
    font-size: 1rem;
    line-height: 1.6;
    transition: height 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
    color: #1f2937;
    overflow-y: hidden;
    overscroll-behavior: contain;
    word-break: break-word;
}

.composer-textarea.is-scrollable {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.composer-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.composer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.composer-actions-left,
.composer-actions-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.composer-actions-left {
    flex-wrap: wrap;
    row-gap: 0.35rem;
}

.composer-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
    color: #475569;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.composer-icon-button:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.composer-new-chat-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px -4px rgba(99, 102, 241, 0.6);
    transition: all 0.2s ease;
}

.composer-new-chat-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -4px rgba(99, 102, 241, 0.7);
}

.composer-send-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #4f46e5, #9333ea);
    color: #ffffff;
    box-shadow: 0 16px 30px -18px rgba(79, 70, 229, 0.9);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.composer-send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px -16px rgba(79, 70, 229, 0.95);
}

.composer-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s ease;
}

.composer-chip:hover {
    background: #e2e8f0;
}

.composer-chip.ephemeral-active {
    background: #ecfdf5;
    border-color: #34d399;
    color: #047857;
}

.voice-status {
    font-size: 0.7rem;
    color: #64748b;
    min-width: 120px;
}

.attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    border: none;
}

.attachment-chip--summary {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.attachment-chip-label {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-chip .remove-attachment-btn {
    border: none;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 999px;
    padding: 2px 8px;
    cursor: pointer;
    font-weight: 600;
}

.attachment-chip .remove-attachment-btn:hover {
    background: #fecaca;
}

.attachment-chip--clear {
    background: none;
    color: #dc2626;
    text-decoration: underline;
    padding: 0;
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- ANIMATIONS DE PROGRESSION --- */
@keyframes pulse-progress {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.progress-pulse {
    animation: pulse-progress 1s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
}

#progress-container {
    transition: all 0.3s ease;
    overflow: hidden;
}

#progress-bar {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

#progress-status {
    transition: opacity 0.3s ease, color 0.3s ease;
}

/* --- NOTIFICATIONS DE MEMOIRE --- */
.memory-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-left: 4px solid #6366f1;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    display: none;
}

.memory-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.memory-notification-content {
    padding: 20px;
}

.memory-notification-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #6366f1;
    font-weight: 600;
}

.memory-notification-header i {
    font-size: 18px;
}

.memory-notification p {
    margin: 0 0 16px 0;
    color: #6b7280;
    line-height: 1.5;
}

.memory-notification-actions {
    display: flex;
    gap: 8px;
}

.memory-notification-actions .btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.memory-notification-actions .btn-primary {
    background: #6366f1;
    color: white;
}

.memory-notification-actions .btn-primary:hover {
    background: #5856eb;
}

.memory-notification-actions .btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.memory-notification-actions .btn-secondary:hover {
    background: #e5e7eb;
}

/* --- NOUVEAU STYLE DE CARTE --- */
.mockup-card {
    background-color: white;
    border-radius: 24px;
    padding: 2rem; /* p-8 */
    box-shadow: 0 10px 25px -5px rgba(66, 153, 225, 0.1), 0 4px 6px -2px rgba(66, 153, 225, 0.05);
    transition: all 0.3s ease-in-out;
}

.dashboard-layout {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 320px minmax(0, 1fr);
        align-items: start;
    }
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-quick-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-align: left;
    padding: 1.5rem;
    position: relative;
    overflow: visible;
}

.dashboard-quick-card--condensed {
    padding: 1.25rem;
    gap: 0.85rem;
}

.dashboard-quick-card--link {
    text-decoration: none;
    color: inherit;
}

.dashboard-quick-card--link:hover {
    transform: translateY(-4px);
}

.dashboard-quick-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-quick-card-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dashboard-quick-card--compact {
    gap: 1rem;
}

.dashboard-quick-card--compact .dashboard-quick-card-header {
    justify-content: flex-start;
}

.dashboard-quick-card--compact .dashboard-quick-card-title {
    margin: 0;
}

.dashboard-quick-card--cta {
    cursor: pointer;
    transition: all 0.3s ease;
}

.dashboard-quick-card--cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -8px rgba(66, 153, 225, 0.3);
}

.dashboard-cta-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
    font-style: italic;
}

.dashboard-quick-card-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px -6px rgba(79, 70, 229, 0.4);
}

.dashboard-icon-image {
    width: 3rem;
    height: auto;
    max-height: 3rem;
    object-fit: contain;
}

.gradient-blue {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.gradient-purple {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.gradient-pink {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.dashboard-quick-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.25rem;
}

.dashboard-quick-card-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

.dashboard-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-info-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.dashboard-info-btn {
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
    border: none;
    border-radius: 9999px;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.dashboard-info-btn:hover,
.dashboard-info-btn:focus {
    background: rgba(79, 70, 229, 0.2);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

.dashboard-info-wrapper:focus-within .dashboard-tooltip,
.dashboard-info-wrapper:hover .dashboard-tooltip {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dashboard-tooltip {
    position: absolute;
    top: 120%;
    right: 0;
    background: #0f172a;
    color: #f8fafc;
    padding: 1rem 1.1rem;
    border-radius: 0.9rem;
    min-width: 260px;
    max-width: 320px;
    box-shadow: 0 15px 35px -20px rgba(15, 23, 42, 0.6);
    font-size: 0.75rem;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 9999;
}

.dashboard-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 16px;
    width: 12px;
    height: 12px;
    background: #0f172a;
    transform: rotate(45deg);
}

.dashboard-tooltip p {
    margin: 0 0 0.35rem 0;
    font-weight: 500;
}

.dashboard-tooltip p:last-child {
    margin-bottom: 0.35rem;
}

.dashboard-tooltip .link {
    color: #a5b4fc;
    font-weight: 600;
}

.dashboard-tooltip .link:hover {
    text-decoration: underline;
}

.dashboard-quick-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: #4338ca;
    font-size: 0.9rem;
}

.dashboard-quick-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-quick-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #475569;
}

.dashboard-quick-list strong {
    font-weight: 600;
    color: #1f2937;
}

.dashboard-quick-list .muted {
    color: #94a3b8;
    font-weight: 500;
}

.dashboard-quick-list .link {
    color: #4338ca;
    font-weight: 600;
    text-decoration: none;
}

.dashboard-quick-list .link:hover {
    text-decoration: underline;
}

.dashboard-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.dashboard-form-actions {
    display: flex;
    gap: 0.75rem;
}

.dashboard-form-actions .dashboard-file-input,
.dashboard-form-actions .dashboard-submit {
    flex: 1;
}

.dashboard-file-input {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.45rem 0.75rem;
    border-radius: 0.75rem;
}

.dashboard-file-name,
.dashboard-progress-status {
    min-height: 1.25rem;
    font-size: 0.8rem;
    color: #475569;
}

.dashboard-inline-info {
    min-height: 0.75rem;
    font-size: 0.76rem;
    color: #475569;
}

.dashboard-inline-warning {
    min-height: 0.75rem;
    font-size: 0.76rem;
    color: #b45309;
}

.dashboard-file-warning {
    font-size: 0.8rem;
    color: #b45309;
}

.dashboard-submit {
    width: 100%;
    padding: 0.45rem 0.75rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.dashboard-file-input,
.dashboard-submit {
    text-align: center;
}

.dashboard-progress {
    position: relative;
    width: 100%;
    height: 0.75rem;
    border-radius: 1rem;
    background: #e2e8f0;
    overflow: hidden;
}

.dashboard-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: inherit;
    transition: width 0.4s ease;
}

.dashboard-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
    font-weight: 600;
}

.dashboard-dictation-card {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-dictation-header {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.dashboard-dictation-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 20px -12px rgba(79, 70, 229, 0.45);
}

.dashboard-dictation-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.35rem;
}

.dashboard-dictation-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
    max-width: 42rem;
}

.dashboard-dictation-textarea {
    flex: 1;
}

.dashboard-textarea {
    width: 100%;
    min-height: 220px;
    border-radius: 1rem;
    border: 1px solid #d0d7e2;
    padding: 1.25rem;
    font-size: 0.95rem;
    color: #1f2937;
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: vertical;
}

.dashboard-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: white;
}

.dashboard-dictation-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
}

.dashboard-mic-button {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px -8px rgba(79, 70, 229, 0.6);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-mic-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -8px rgba(79, 70, 229, 0.7);
}

.dashboard-dictation-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dashboard-action-btn {
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.9rem;
    border: 1px solid #d6dbe8;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.dashboard-action-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

.dashboard-action-btn-violet {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.4);
}

.dashboard-action-btn-violet:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -4px rgba(79, 70, 229, 0.5);
    color: white;
}

.dashboard-dictation-feedback {
    min-height: 1rem;
    font-size: 0.8rem;
    color: #059669;
}

.dashboard-bottom-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
}

@media (min-width: 1024px) {
    .dashboard-bottom-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dashboard-table-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 2rem;
}


.dashboard-table-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.dashboard-table-heading .dashboard-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-heading-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-heading-actions .dashboard-search-wrapper {
    flex: 1 1 240px;
    min-width: 200px;
}

.dashboard-search-wrapper {
    width: 100%;
}

.dashboard-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    background-color: #fff;
}

.dashboard-search-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

@media (max-width: 640px) {
    .dashboard-heading-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .dashboard-heading-actions .dashboard-search-wrapper {
        flex: 1 1 100%;
        min-width: 0;
    }
}

.dashboard-table-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.dashboard-table-subtitle {
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
}

.dashboard-bulk-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-bulk-btn {
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.dashboard-bulk-btn:hover {
    background: rgba(220, 38, 38, 0.18);
    color: #991b1b;
}

.dashboard-table-columns {
    display: none;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

@media (min-width: 768px) {
    .dashboard-table-columns {
        display: grid;
        grid-template-columns: minmax(0, 1.6fr) 0.9fr 0.9fr;
        gap: 1rem;
        padding: 0 0.75rem;
    }
}

.dashboard-table-col-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.dashboard-checkbox {
    width: 1rem;
    height: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.35rem;
}

.dashboard-table-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-table-content .file-row,
.dashboard-table-content .conversation-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 0.9fr 0.9fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-radius: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-table-content .file-row:hover,
.dashboard-table-content .conversation-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 25px -18px rgba(30, 64, 175, 0.35);
}

.file-row-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.file-row-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 0.9rem;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.file-row-icon img {
    width: 1.75rem;
    height: 1.75rem;
}

.file-row-title {
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-row-date {
    font-size: 0.85rem;
    color: #64748b;
}

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

.file-row-actions-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-empty-state {
    margin: 0;
    padding: 1rem 0;
    font-size: 0.9rem;
    color: #94a3b8;
}

@media (max-width: 767px) {
    .dashboard-table-content .file-row,
    .dashboard-table-content .conversation-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .file-row-actions,
    .file-row-date {
        justify-self: flex-start;
    }

    .dashboard-dictation-card {
        padding: 1.75rem;
    }

    .dashboard-textarea {
        min-height: 180px;
        padding: 1rem;
    }

    .dashboard-mic-button {
        width: 3rem;
        height: 3rem;
    }
}

/* --- NOUVEAUX STYLES DE BOUTONS --- */

/* Boutons principaux avec dégradé */
.btn-gradient-primary {
    background-image: linear-gradient(to right, #4f46e5 0%, #7c3aed 100%); /* indigo-600 to purple-600 */
    color: white;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px -5px rgba(79, 70, 229, 0.4);
}
.btn-gradient-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px -5px rgba(79, 70, 229, 0.5);
}
.btn-gradient-primary:disabled,
.btn-gradient-primary.disabled,
.btn-gradient-primary[disabled] {
    background-image: linear-gradient(to right, #e0e7ff 0%, #ede9fe 100%);
    color: #a5b4fc;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

/* Boutons "pilule" pour la navigation de l'en-tête */
.btn-gradient-pill {
    background-image: linear-gradient(to right, #60a5fa 0%, #818cf8 100%); /* blue-400 to indigo-400 */
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-gradient-pill:hover {
    opacity: 0.9;
    box-shadow: 0 4px 15px -5px rgba(96, 165, 250, 0.4);
}

/* Style pour les labels de téléversement de fichier */
.btn-file-input {
    display: inline-block;
    background-color: #e5e7eb; /* gray-200 */
    color: #374151; /* gray-700 */
    font-weight: 600;
    transition: background-color 0.2s;
}
.btn-file-input:hover {
    background-color: #d1d5db; /* gray-300 */
}

/* Bouton secondaire (ex: Annuler, Arrêter) */
.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #334155;
    border-color: #cbd5e1;
}

/* Correction pour le bouton de sauvegarde - éviter qu'il devienne invisible quand désactivé */
.btn-secondary:disabled,
.btn-secondary[disabled] {
    background-color: #f8fafc;
    color: #94a3b8;
    border-color: #e2e8f0;
    opacity: 1 !important; /* Forcer l'opacité à 1 pour garder l'icône visible */
    cursor: not-allowed;
}

/* Style spécifique pour le bouton de sauvegarde */
#save-conversation-btn {
    opacity: 1 !important; /* Toujours visible */
}

#save-conversation-btn:disabled,
#save-conversation-btn[disabled] {
    background-color: #f8fafc !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
    opacity: 1 !important; /* Forcer la visibilité même quand désactivé */
    cursor: not-allowed !important;
}

/* Mode de chat éphémère */
#ephemeral-mode-btn {
    position: relative;
    transition: all 0.2s ease;
}

#ephemeral-mode-btn .ephemeral-indicator {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
    background-color: #cbd5f5; /* violet pâle pour mode inactif */
    box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.2);
    display: inline-block;
}

#ephemeral-mode-btn .ephemeral-label {
    white-space: nowrap;
}

#ephemeral-mode-btn.ephemeral-active {
    background-color: #f0f9ff;
    color: #0369a1;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

#ephemeral-mode-btn.ephemeral-active .ephemeral-indicator {
    background-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

/* --- NOUVEAUX STYLES POUR LES LIENS D'ACTION --- */
.action-link {
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
}
.action-link:hover {
    opacity: 0.8;
    background-color: rgba(255, 255, 255, 0.1);
}
.action-link-primary { 
    color: #3b82f6; 
}
.action-link-primary:hover { 
    background-color: rgba(59, 130, 246, 0.1); 
}
.action-link-rename { 
    color: #f97316; 
}
.action-link-rename:hover { 
    background-color: rgba(249, 115, 22, 0.1); 
}
.action-link-delete { 
    color: #ef4444; 
}
.action-link-delete:hover { 
    background-color: rgba(239, 68, 68, 0.1); 
}

.action-link-more {
    color: #64748b;
}

.action-link-more:hover {
    background-color: rgba(100, 116, 139, 0.1);
}

/* Menu déroulant pour actions */
.action-menu-wrapper {
    position: relative;
}

.action-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.25rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    min-width: 180px;
    z-index: 50;
    padding: 0.5rem 0;
}

.action-menu-wrapper.active .action-dropdown {
    display: block;
}

.action-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    width: 100%;
    text-align: left;
    color: #475569;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    border-radius: 0;
}

.action-dropdown-item:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.action-dropdown-item svg,
.action-dropdown-item img {
    flex-shrink: 0;
}

/* --- ANCIENS STYLES (conservés pour compatibilité si besoin) --- */
.card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* --- STYLES SPÉCIFIQUES POUR L'ADMINISTRATION --- */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.admin-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid #e2e8f0;
}
.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}
.admin-table tr:hover {
    background-color: #f8fafc;
}

/* Amélioration des champs de formulaire */
input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    border: 1px solid #d1d5db;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Espacement uniforme pour les sections */
.admin-section {
    margin-bottom: 2rem;
}
.admin-section:last-child {
    margin-bottom: 0;
}
.btn-primary {
    background-color: #4f46e5;
    color: white;
    border: none;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}
.btn-primary:hover {
    background-color: #4338ca;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transform: translateY(-1px);
}

/* Notifications de mémoire */
.memory-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #3182ce;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.memory-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.memory-notification-content {
    padding: 16px;
}

.memory-notification-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #3182ce;
}

.memory-notification-header i {
    margin-right: 8px;
    font-size: 16px;
}

.memory-notification p {
    margin: 0 0 12px 0;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.4;
}

.memory-notification-actions {
    display: flex;
    gap: 8px;
}

.memory-notification-actions .btn {
    font-size: 12px;
    padding: 4px 12px;
}

/* Styles pour la page de profil utilisateur */
.tab-content {
    margin-top: 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.profile-tab {
    transition: all 0.2s ease;
    cursor: pointer;
}

.profile-tab:hover {
    color: #64748b !important;
    border-color: #cbd5e1 !important;
}

/* Animation pour les messages */
@keyframes fade-in {
    from { 
        opacity: 0; 
        transform: translate(-50%, -20px) scale(0.95);
    }
    to { 
        opacity: 1; 
        transform: translate(-50%, 0) scale(1);
    }
}

.animate-fade-in { 
    animation: fade-in 0.3s ease-out;
}

/* Styles pour les toggles/switches */
.peer:checked ~ div {
    background-color: currentColor;
}

/* Améliorations pour les boutons secondaires */
.btn-secondary {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

/* Responsive design pour la page de profil */
@media (max-width: 768px) {
    .grid.grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .flex.justify-between {
        flex-direction: column;
        gap: 1rem;
    }
    
    .flex.justify-between .flex {
        justify-content: center;
    }
}

/* --- Mise en forme des messages du chatbot --- */
.message-content {
    line-height: 1.7;
    font-size: 0.975rem;
}
.message-content p { margin: 0 0 0.75rem 0; }
.message-content p:last-child { margin-bottom: 0; }
.message-content ul, .message-content ol { margin: 0.5rem 0 0.75rem 1.25rem; }
.message-content li { margin: 0.25rem 0; }
.message-content blockquote {
    border-left: 4px solid #c7d2fe;
    padding-left: 0.75rem;
    color: #475569;
    background: #eef2ff;
    border-radius: 6px;
    margin: 0.75rem 0;
}
.message-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 0.75rem;
    border-radius: 8px;
    overflow: auto;
    margin: 0.75rem 0;
}
.message-content code {
    background: #f1f5f9;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}
.message-content pre code { background: transparent; padding: 0; }
.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
}
.message-content th, .message-content td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.6rem;
}
.message-content th { background: #f8fafc; text-align: left; }
.message-content img { max-width: 100%; height: auto; border-radius: 6px; }

/* Boutons d'action (copie / édition) sur les réponses */


/* --- Éditeur riche (modal) pour éditer une réponse --- */
#edit-message-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
#edit-message-modal .modal-card {
    background: #ffffff;
    width: min(100%, 900px);
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
}
.rte-toolbar {
    display: flex;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.rte-toolbar button {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.rte-toolbar button:hover { background: #f1f5f9; }
.rte-area {
    padding: 12px;
    overflow: auto;
    flex: 1;
}
.rte-actions {
    padding: 10px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    border-top: 1px solid #e2e8f0;
}