/* ==========================================================================
   AI assistant — same corporate identity, 3-column layout (from ref. 3)
   ========================================================================== */
.ai-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) 300px; gap: var(--gutter); align-items: stretch; }
.ai-left .card-body, .ai-right .card-body { display: flex; flex-direction: column; }
.conv-list { list-style: none; margin: 0; padding: 0; }
.conv-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 8px; border: 0; background: none; border-radius: var(--radius); text-align: left; }
.conv-item:hover { background: var(--hover-bg); }
.conv-item.active { background: var(--primary-softer); }
.conv-item .ci-title { color: var(--heading); font-size: 13px; font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item .ci-sub { color: var(--text-muted); font-size: 11.5px; display: block; }
.faq-btn { display: flex; gap: 8px; align-items: flex-start; width: 100%; padding: 7px 0; border: 0; background: none; color: var(--text-2); font-size: 12.5px; text-align: left; border-bottom: 1px dashed var(--border); }
.faq-btn:hover { color: var(--primary); }
.faq-btn svg { flex: none; margin-top: 3px; color: var(--primary); }

.chat-card { display: flex; flex-direction: column; height: calc(100vh - var(--header-h) - var(--nav-h) - 120px); min-height: 560px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.chat-head h5 { margin: 0; font-size: 14.5px; }
.chat-head p { margin: 0; color: var(--text-muted); font-size: 12px; }
.chat-head .online { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; margin-right: 4px; }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; background: #fcfcfe; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; margin-bottom: 16px; max-width: 88%; }
.msg .avatar { width: 32px; height: 32px; font-size: 11px; }
.msg .bubble { padding: 10px 14px; border-radius: 4px 12px 12px 12px; background: #fff; border: 1px solid var(--border); color: var(--text-2); font-size: 13px; line-height: 1.55; min-width: 0; overflow-wrap: anywhere; }
.msg .bubble p:last-child { margin-bottom: 0; }
.msg .bubble ul, .msg .bubble ol { margin: 6px 0; padding-left: 18px; }
.msg .bubble table { margin-top: 6px; }
.msg .meta { font-size: 10.5px; color: var(--text-light); margin-top: 4px; }
.msg.user { margin-left: auto; flex-direction: row-reverse; }
.msg.user .bubble { background: var(--primary); color: #fff; border-color: var(--primary); border-radius: 12px 4px 12px 12px; }
.msg.user .meta { text-align: right; }
.msg .why { margin-top: 8px; padding: 8px 10px; background: var(--soft-bg); border-radius: var(--radius); font-size: 12px; color: var(--text-muted); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-light); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.chat-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chat-chips button { border: 1px solid #c9d1f6; background: #fff; color: var(--primary); border-radius: 14px; padding: 4px 11px; font-size: 12px; }
.chat-chips button:hover { background: var(--primary); color: #fff; }
.slot-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 10px; }
.slot-card { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 12px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.slot-card .sc-time { font-size: 15px; font-weight: 600; color: var(--heading); }
.slot-card .sc-date { font-size: 12px; color: var(--text-muted); text-transform: capitalize; }
.slot-card .sc-why { font-size: 11.5px; color: var(--text-muted); list-style: none; padding: 0; margin: 2px 0 4px; }
.slot-card .sc-why li { display: flex; gap: 5px; align-items: flex-start; margin-bottom: 2px; }
.slot-card .sc-why svg { flex: none; margin-top: 2px; color: var(--success); }
.slot-card.chosen { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.confirm-card { border: 1px solid var(--border-strong); border-radius: var(--radius); background: #fff; padding: 14px; margin-top: 10px; }
.chat-input { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: #fff; }
.chat-input .form-control { height: 40px; background: var(--soft-bg); border: 0; border-radius: 20px; padding: 0 16px; }
.chat-input .btn { height: 40px; border-radius: 20px; }
.ai-disclaimer { font-size: 11px; color: var(--text-muted); padding: 0 20px 10px; background: #fff; }

.insight { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.insight:last-child { border-bottom: 0; }
.insight p { margin: 0; font-size: 12.5px; color: var(--text-2); }
.insight h6 { margin: 0 0 2px; font-size: 13px; }

/* Intelligence dashboard cards */
.ai-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter); }
.ai-card .card-body { display: flex; flex-direction: column; height: 100%; }
.ai-card .metric { font-size: 22px; font-weight: 600; color: var(--heading); margin: 10px 0 2px; }
.ai-card .metric-label { color: var(--text-muted); font-size: 12px; margin-bottom: 10px; }
.ai-card dl { margin: 0 0 12px; font-size: 12.5px; }
.ai-card dt { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-top: 8px; }
.ai-card dd { margin: 2px 0 0; color: var(--text-2); }
.ai-card .btn { margin-top: auto; align-self: flex-start; }
.heatmap { display: grid; gap: 3px; font-size: 11px; }
.heatmap .hm-cell { height: 26px; border-radius: 3px; display: grid; place-items: center; color: #fff; font-size: 10.5px; }
.heatmap .hm-label { color: var(--text-muted); display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; }
.heatmap .hm-col { color: var(--text-muted); text-align: center; }
