/* Chatbot Assistant Coordinateur */
.coord-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 850px;
    max-height: 900px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.coord-chatbot.open {
    display: flex;
}

.coord-chatbot-header {
    background: linear-gradient(135deg, #008000 0%, #006400 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.coord-chatbot-header h4 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.coord-chatbot-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.coord-chatbot-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.coord-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 650px;
}

.coord-chatbot-message {
    display: flex;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.coord-chatbot-message.bot {
    justify-content: flex-start;
}

.coord-chatbot-message.user {
    justify-content: flex-end;
}

.coord-chatbot-message-content {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.coord-chatbot-message.bot .coord-chatbot-message-content {
    background: white;
    border: 1px solid #e9ecef;
    color: #333;
}

.coord-chatbot-message.user .coord-chatbot-message-content {
    background: #008000;
    color: white;
}

.coord-chatbot-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.coord-chatbot-option {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    text-align: left;
}

.coord-chatbot-option:hover {
    background: #e9ecef;
    border-color: #008000;
    transform: translateX(4px);
}

.coord-chatbot-input-area {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 0.5rem;
}

.coord-chatbot-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
}

.coord-chatbot-input:focus {
    border-color: #008000;
}

.coord-chatbot-send-btn {
    background: #008000;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.coord-chatbot-send-btn:hover {
    background: #006400;
}

.coord-chatbot-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.coord-chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #008000 0%, #006400 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 128, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: transform 0.2s, box-shadow 0.2s;
}

.coord-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 128, 0, 0.5);
}

.coord-chatbot-toggle.hidden {
    display: none;
}

.coord-chatbot-recommendations {
    background: #e7f5e7;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.coord-chatbot-recommendations h5 {
    margin: 0 0 0.75rem 0;
    color: #155724;
    font-size: 0.95rem;
}

.coord-chatbot-recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    position: relative;
}

.coord-chatbot-recommendations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    border-radius: 6px 6px 0 0;
    font-size: 0.85rem;
    position: sticky;
    top: 0;
    z-index: 10;
    margin-bottom: 0.25rem;
}

.coord-chatbot-recommendations-header strong {
    color: #155724;
    font-weight: 600;
}

.coord-chatbot-recommendations-header span:first-child {
    flex: 1;
}

.coord-chatbot-recommendations-header span:nth-child(2) {
    min-width: 60px;
    text-align: right;
}

.coord-chatbot-recommendation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    font-size: 0.85rem;
}

.coord-chatbot-recommendation-item strong {
    color: #008000;
}

.coord-chatbot-apply-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.75rem;
    width: 100%;
    transition: background 0.2s;
}

.coord-chatbot-apply-btn:hover {
    background: #218838;
}

.coord-chatbot-recalc-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: background 0.2s;
    margin-left: 0.5rem;
}

.coord-chatbot-recalc-btn:hover {
    background: #0056b3;
}

.coord-chatbot-recalc-family-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    transition: background 0.2s;
    margin-left: 0.5rem;
}

.coord-chatbot-recalc-family-btn:hover {
    background: #5a6268;
}

.coord-chatbot-recommendation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    font-size: 0.85rem;
}

.coord-chatbot-recommendation-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
}

.coord-chatbot-recommendation-item-content span:first-child {
    flex: 1;
}

.coord-chatbot-recommendation-item-content span:nth-child(2) {
    min-width: 60px;
    text-align: right;
    margin-right: 2rem;
}

.coord-chatbot-recommendation-item-actions {
    display: flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.coord-chatbot-recalc-surface-input {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: center;
}

.coord-chatbot-recalc-surface-input input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.85rem;
}

.coord-chatbot-recalc-surface-input input:focus {
    border-color: #007bff;
    outline: none;
}

.coord-magasin-row {
    cursor: pointer;
    transition: background 0.2s;
}

.coord-magasin-row:hover {
    background: #e7f5e7 !important;
}

.coord-magasin-quantities {
    max-height: 400px;
    overflow-y: auto;
}

.coord-magasin-quantities table {
    font-size: 0.8rem;
}

.coord-magasin-quantities thead {
    position: sticky;
    top: 0;
    z-index: 10;
}
