/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #E8EDF4;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Shell ────────────────────────────────────────────────────────────────── */
.chat-container {
    width: 100%;
    max-width: 980px;
    height: 96vh;
    display: flex;
    flex-direction: column;
    background: #F4F7FB;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(9,15,78,.13);
    overflow: hidden;
    border: 1px solid #D6E2F0;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.chat-header {
    background: linear-gradient(135deg, #09518C 0%, #090F4E 100%);
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-icon {
    width: 34px; height: 34px;
    background: rgba(255,255,255,.15);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}
.header-icon i { font-size: 16px; color: #fff; }
.header-left h1 { font-size: 15px; color: #fff; font-weight: 700; letter-spacing: .2px; }
.header-right { display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,.75); font-size: 12px; font-weight: 500; }
.status-dot { width: 8px; height: 8px; background: #34B86D; border-radius: 50%; box-shadow: 0 0 0 2px rgba(52,184,109,.3); animation: pulse 2.2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.4;} }

/* ── Quick Actions ────────────────────────────────────────────────────────── */
.quick-actions {
    padding: 10px 16px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    background: #fff;
    border-bottom: 1px solid #E2E8F0;
    flex-shrink: 0;
}
.quick-actions button {
    background: #F4F7FB;
    border: 1px solid #D6E2F0;
    color: #09518C;
    padding: 6px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: .1px;
}
.quick-actions button i { font-size: 11px; opacity: .85; }
.quick-actions button:hover { background: #09518C; color: #fff; border-color: #09518C; }
.quick-actions button:hover i { opacity: 1; }

/* ── Messages Area ────────────────────────────────────────────────────────── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #F4F7FB;
    scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #C8D9EC; border-radius: 4px; }

/* ── Message Bubbles ──────────────────────────────────────────────────────── */
.message { display: flex; gap: 10px; max-width: 96%; animation: fadeUp .22s ease; }
@keyframes fadeUp { from{opacity:0;transform:translateY(10px);} to{opacity:1;transform:translateY(0);} }
.message.bot { align-self: flex-start; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }

.message-content {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.7;
}
.message.bot .message-content {
    background: #fff;
    color: #1A2340;
    border: 1px solid #E2E8F0;
    border-bottom-left-radius: 4px;
    width: 100%;
    box-shadow: 0 2px 8px rgba(9,81,140,.06);
}
.message.user .message-content {
    background: linear-gradient(135deg, #09518C, #0a6bb5);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(9,81,140,.2);
}

/* ── ## Section Title ─────────────────────────────────────────────────────── */
.msg-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #090F4E;
    padding: 10px 14px;
    margin: 2px 0 10px;
    background: linear-gradient(135deg, #EDF5FF, #F0F6FF);
    border-radius: 10px;
    border-left: 4px solid #09518C;
    letter-spacing: -.1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── ### Section Card ─────────────────────────────────────────────────────── */
.msg-card {
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(9,81,140,.05);
}
.msg-card-head {
    background: #09518C;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.msg-card-head::before {
    content: '';
    width: 3px; height: 14px;
    background: rgba(255,255,255,.5);
    border-radius: 2px;
    flex-shrink: 0;
}
.msg-card-body { background: #fff; padding: 2px 0; }
.msg-card-body .info-list li {
    padding: 8px 14px 8px 34px;
    border-bottom: 1px solid #F0F4F8;
    font-size: 13px;
    color: #1A2340;
    line-height: 1.55;
}
.msg-card-body .info-list li:last-child { border-bottom: none; }
.msg-card-body .info-list li::before { left: 14px; top: 14px; width: 5px; height: 5px; background: #09518C; }
.msg-card-body .info-list li.sub-item { padding-left: 46px; color: #5A6A80; font-size: 12px; background: #FAFBFC; }
.msg-card-body .info-list li.sub-item::before { left: 30px; background: #C8D9EC; width: 4px; height: 4px; }
.msg-card-body p { padding: 8px 14px; font-size: 13px; color: #3D4A5C; margin: 0; }

/* ── #### Urgent Case Card ────────────────────────────────────────────────── */
.case-card {
    border: 1px solid #D6E2F0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(9,15,78,.07);
    transition: box-shadow .18s;
}
.case-card:hover { box-shadow: 0 4px 16px rgba(9,15,78,.12); }

.case-card-head {
    background: linear-gradient(135deg, #090F4E 0%, #0d1a6e 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    letter-spacing: .1px;
}
.case-card-head-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.case-card-body { background: #fff; }

.case-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 8px 14px;
    font-size: 12.5px;
    border-bottom: 1px solid #F0F4F8;
    line-height: 1.5;
}
.case-row:last-child { border-bottom: none; }
.case-row i { margin-top: 2px; flex-shrink: 0; font-size: 12px; }
.case-row span { flex: 1; }

.flag-high  { background: #FFF5F5; color: #B91C1C; }
.flag-high i { color: #DC2626; }
.flag-med   { background: #FFFBEB; color: #92400E; }
.flag-med i { color: #D97706; }
.flag-info  { background: #EFF6FF; color: #1E40AF; }
.flag-info i { color: #3B82F6; }
.flag-form  { background: #F0FDF4; color: #166534; }
.flag-form i { color: #22C55E; }
.flag-action { background: #F8FAFC; color: #334155; }
.flag-action i { color: #64748B; }
.flag-whynow  { background: #FFF7ED; color: #9A3412; font-style: italic; font-size: 12.5px; }
.flag-whynow i { color: #F97316; }

/* View Case button */
.case-view-btn {
    background: rgba(255,255,255,.18);
    color: #fff;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 6px;
    padding: 4px 11px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .18s, border-color .18s;
    text-decoration: none;
    letter-spacing: .1px;
}
.case-view-btn:hover { background: rgba(255,255,255,.32); border-color: rgba(255,255,255,.7); color: #fff; text-decoration: none; }
.case-view-btn i { font-size: 10px; }

/* ── Inline Case Link ─────────────────────────────────────────────────────── */
.case-inline-link {
    color: #09518C;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1.5px solid rgba(9,81,140,.25);
    padding-bottom: 1px;
    transition: color .15s, border-color .15s;
}
.case-inline-link:hover { color: #090F4E; border-color: #090F4E; text-decoration: none; }
.case-inline-link .fas { font-size: 9px; margin-left: 3px; vertical-align: middle; }

/* ── Tier Labels ──────────────────────────────────────────────────────────── */
.tier-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 5px 12px;
    margin: 8px 0 6px;
    border-radius: 6px;
    display: inline-block;
}
.tier-1 { background: #FEF2F2; color: #991B1B; border-left: 3px solid #DC2626; }
.tier-2 { background: #FFFBEB; color: #92400E; border-left: 3px solid #D97706; }
.tier-3 { background: #F0FDF4; color: #166534; border-left: 3px solid #22C55E; }

/* ── Duplicate Warning ────────────────────────────────────────────────────── */
.duplicate-warning {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-left: 3px solid #F59E0B;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12.5px;
    color: #78350F;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.duplicate-warning i { color: #F59E0B; margin-top: 2px; flex-shrink: 0; }

/* ── Lists ────────────────────────────────────────────────────────────────── */
.info-list { list-style: none; padding: 0; margin: 4px 0; }
.info-list li {
    padding: 6px 0 6px 20px;
    position: relative;
    color: #334155;
    font-size: 13px;
    border-bottom: 1px solid #F0F4F8;
    line-height: 1.6;
}
.info-list li:last-child { border-bottom: none; }
.info-list li::before {
    content: '';
    position: absolute;
    left: 6px; top: 13px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #09518C;
}
.info-list li.sub-item { padding-left: 36px; font-size: 12px; color: #64748B; }
.info-list li.sub-item::before { left: 22px; width: 4px; height: 4px; background: #C8D9EC; }
ol.info-list { counter-reset: item; }
ol.info-list li { counter-increment: item; }
ol.info-list li::before {
    content: counter(item);
    background: #09518C; color: #fff;
    width: 17px; height: 17px;
    border-radius: 50%;
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    top: 7px; left: 0;
}

/* ── Paragraphs & Inline ──────────────────────────────────────────────────── */
.message-content p { margin: 5px 0; color: #334155; }
.message.user .message-content p { color: #fff; }
.message-content strong { color: #090F4E; font-weight: 600; }
.message.user .message-content strong { color: #fff; }
.message.user .message-content em { color: rgba(255,255,255,.85); }
.message.user .message-content li { color: #fff; border-bottom-color: rgba(255,255,255,.15); }
.message.user .message-content li::before { background: rgba(255,255,255,.7); }
.message.user .message-content li.sub-item { color: rgba(255,255,255,.8); }
.message-content em { color: #64748B; font-style: italic; }
.message-content code { background: #F1F5F9; padding: 2px 6px; border-radius: 4px; font-size: 12px; color: #09518C; border: 1px solid #E2E8F0; font-family: 'SF Mono', monospace; }

.section-title {
    font-size: 11px;
    font-weight: 700;
    color: #09518C;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin: 12px 0 5px;
    padding-bottom: 4px;
    border-bottom: 1px solid #E2E8F0;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-wrap { margin: 8px 0; border-radius: 8px; overflow: hidden; border: 1px solid #E2E8F0; }
.message-content table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.message-content th { background: #09518C; color: #fff; padding: 8px 12px; text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; }
.message-content td { padding: 7px 12px; color: #1A2340; border-top: 1px solid #E2E8F0; }
.message-content tr:nth-child(even) td { background: #F8FAFC; }
.message-content tr:hover td { background: #EFF6FF; }

/* ── Typing Indicator ─────────────────────────────────────────────────────── */
.typing { display: flex; gap: 5px; padding: 6px 4px; align-items: center; }
.typing span { width: 7px; height: 7px; background: #09518C; border-radius: 50%; animation: bounce 1.4s infinite; opacity: .7; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%,60%,100%{transform:translateY(0);} 30%{transform:translateY(-8px);} }

/* ── Suggestions ──────────────────────────────────────────────────────────── */
.suggestions {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 2px 0 4px;
    animation: fadeUp .22s ease;
    margin-left: 44px;
}
.suggestions-label {
    font-size: 11px;
    font-weight: 600;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 0 0 6px 2px;
}
.suggestions button {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    color: #1A2340;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    text-align: left;
    width: 100%;
    margin-bottom: 5px;
    box-shadow: 0 1px 3px rgba(9,81,140,.05);
}
.suggestions button:last-child { margin-bottom: 0; }
.suggestions button .sugg-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: #EDF5FF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    color: #09518C;
    transition: background .15s;
}
.suggestions button .sugg-text {
    flex: 1;
    line-height: 1.3;
}
.suggestions button .sugg-arrow {
    color: #C8D9EC;
    font-size: 11px;
    flex-shrink: 0;
    transition: color .15s, transform .15s;
}
.suggestions button:hover {
    background: #EDF5FF;
    border-color: #09518C;
    color: #09518C;
}
.suggestions button:hover .sugg-icon {
    background: #09518C;
    color: #fff;
}
.suggestions button:hover .sugg-arrow {
    color: #09518C;
    transform: translateX(2px);
}

/* ── Input Area ───────────────────────────────────────────────────────────── */
.chat-input {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #E2E8F0;
    flex-shrink: 0;
}
.input-row { display: flex; gap: 8px; align-items: center; }
#caseId {
    width: 110px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid #E2E8F0;
    background: #F8FAFC;
    color: #1A2340;
    font-size: 13px;
    transition: border-color .18s;
}
#messageInput {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1.5px solid #E2E8F0;
    background: #F8FAFC;
    color: #1A2340;
    font-size: 13.5px;
    outline: none;
    transition: border-color .18s, background .18s;
}
#messageInput:focus, #caseId:focus { border-color: #09518C; background: #fff; box-shadow: 0 0 0 3px rgba(9,81,140,.08); }
#messageInput::placeholder, #caseId::placeholder { color: #A0AEC0; }
#sendBtn {
    width: 42px; height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #09518C, #0a6bb5);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    transition: all .18s;
    box-shadow: 0 2px 8px rgba(9,81,140,.25);
    flex-shrink: 0;
}
#sendBtn:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(9,81,140,.35); }
#sendBtn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ── Priorities Panel (case page) ─────────────────────────────────────────── */
#priorities-panel {
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    padding: 12px 16px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 13px;
}
#priorities-panel .panel-content { color: #1A2340; }
#priorities-panel .panel-loading { color: #64748B; padding: 8px 0; }
#priorities-panel .panel-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #E2E8F0; }
#priorities-panel .panel-suggestions button { background: #fff; color: #09518C; border: 1px solid #D6E2F0; border-radius: 12px; padding: 4px 10px; font-size: 11px; cursor: pointer; transition: background .18s; }
#priorities-panel .panel-suggestions button:hover { background: #09518C; color: #fff; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .chat-container { height: 100vh; border-radius: 0; max-width: 100%; }
    #caseId { width: 80px; }
    .message { max-width: 99%; }
    .message-content { padding: 10px 13px; }
    .quick-actions { padding: 8px 12px; gap: 5px; }
    .quick-actions button { padding: 5px 10px; font-size: 11px; }
}

/* ── KPI Strip Rows (morning brief) ──────────────────────────────────────── */
.kpi-row {
    display: flex;
    align-items: flex-start;
    padding: 9px 14px;
    margin: 3px 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    border-left: 4px solid transparent;
}
.kpi-row strong { font-weight: 700; }
.kpi-icon { margin-right: 7px; width: 14px; text-align: center; }
.kpi-priority   { background: #FFF5F5; color: #7F1D1D; border-left-color: #DC2626; font-weight: 600; }
.kpi-compliance { background: #FFF5F5; color: #7F1D1D; border-left-color: #DC2626; }
.kpi-unread     { background: #EFF6FF; color: #1E3A5F; border-left-color: #3B82F6; }
.kpi-blocker    { background: #FFFBEB; color: #78350F; border-left-color: #F59E0B; }
.kpi-cash       { background: #F0FDF4; color: #14532D; border-left-color: #22C55E; }
.kpi-order      { background: #F8FAFC; color: #334155; border-left-color: #94A3B8; font-style: italic; font-size: 12px; }
.kpi-info       { background: #F8FAFC; color: #334155; border-left-color: #94A3B8; }

.case-meta { background: #F8FAFC; color: #64748B; font-size: 12px; }
.case-meta i { color: #94A3B8; }

.quick-actions button.active { background: #09518C; color: #fff; border-color: #09518C; }
.quick-actions button.active i { opacity: 1; }

/* ── Compliance triage blocks ─────────────────────────────────────────────── */
.comp-block { border-radius: 10px; margin: 8px 0; overflow: hidden; border: 1px solid rgba(0,0,0,.08); }
.comp-block-head { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; font-weight: 600; font-size: 13px; }
.comp-block-head i { margin-top: 2px; flex-shrink: 0; }
.comp-block-action { display: flex; align-items: flex-start; gap: 8px; padding: 7px 14px 7px 38px; font-size: 12px; border-top: 1px solid rgba(0,0,0,.06); }
.comp-block-action i { margin-top: 2px; flex-shrink: 0; opacity: .7; }
.comp-block-cases { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 10px 38px; border-top: 1px solid rgba(0,0,0,.06); }
.comp-case-link { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 3px 8px; border-radius: 5px; text-decoration: none; font-weight: 500; background: rgba(0,0,0,.06); color: inherit; }
.comp-case-link:hover { background: rgba(0,0,0,.12); }
.comp-case-link i { font-size: 10px; opacity: .7; }
.comp-critical { background: #FFF0F0; color: #7F1D1D; border-color: #FCA5A5; }
.comp-critical .comp-block-head { background: #DC2626; color: #fff; }
.comp-critical .comp-case-link { background: rgba(220,38,38,.12); color: #7F1D1D; }
.comp-high { background: #FFF5F0; color: #7C2D12; border-color: #FDBA74; }
.comp-high .comp-block-head { background: #EA580C; color: #fff; }
.comp-high .comp-case-link { background: rgba(234,88,12,.12); color: #7C2D12; }
.comp-medium { background: #FFFBEB; color: #78350F; border-color: #FCD34D; }
.comp-medium .comp-block-head { background: #D97706; color: #fff; }
.comp-medium .comp-case-link { background: rgba(217,119,6,.12); color: #78350F; }
.comp-low { background: #FEFCE8; color: #713F12; border-color: #FDE68A; }
.comp-low .comp-block-head { background: #CA8A04; color: #fff; }
.comp-low .comp-case-link { background: rgba(202,138,4,.12); color: #713F12; }
.comp-case-extra { font-size: 10px; opacity: .7; margin-left: 4px; font-weight: 400; }
.comp-case-more { display: inline-flex; align-items: center; font-size: 11px; padding: 3px 8px; border-radius: 5px; background: rgba(0,0,0,.06); color: inherit; font-style: italic; opacity: .8; }

/* ── Bottleneck stage table ───────────────────────────────────────────────── */
.stage-table { border-radius: 10px; overflow: hidden; margin: 8px 0; border: 1px solid rgba(0,0,0,.08); }
.stage-table-head { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: #F59E0B; color: #fff; font-weight: 600; font-size: 13px; }
.stage-table-head i { font-size: 13px; }
.stage-table-row { display: flex; align-items: center; padding: 7px 14px; border-top: 1px solid rgba(0,0,0,.06); font-size: 12px; gap: 8px; background: #FFFBEB; }
.stage-table-row:nth-child(even) { background: #FEF3C7; }
.stage-label { font-weight: 600; min-width: 100px; color: #78350F; }
.stage-cell { color: #92400E; flex: 1; }

/* ── Longest inactive list ────────────────────────────────────────────────── */
.inactive-list { margin: 8px 0; border-radius: 10px; overflow: hidden; border: 1px solid rgba(0,0,0,.08); }
.inactive-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid rgba(0,0,0,.06); font-size: 12px; background: #fff; }
.inactive-row:first-child { border-top: none; }
.inactive-case-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: #1E3A5F; text-decoration: none; flex: 1; }
.inactive-case-link:hover { text-decoration: underline; }
.inactive-case-link i { font-size: 10px; opacity: .6; }
.inactive-status { color: #64748B; min-width: 90px; }
.inactive-days { font-weight: 700; color: #DC2626; margin-left: auto; white-space: nowrap; }
/* Task 11: Cash flow / Client forms / Unread notes card polish */
.cashflow-section{border-radius:10px;overflow:hidden;margin:8px 0;border:1px solid rgba(0,0,0,.08)}
.cashflow-head{display:flex;align-items:center;gap:8px;padding:9px 14px;background:#16A34A;color:#fff;font-weight:600;font-size:13px}
.cashflow-row{display:flex;align-items:center;justify-content:space-between;padding:8px 14px;border-top:1px solid rgba(0,0,0,.06);font-size:12px;background:#F0FDF4}
.cashflow-row:nth-child(even){background:#DCFCE7}
.cashflow-label{color:#14532D;font-weight:500}
.cashflow-value{font-weight:700;color:#15803D}
.cashflow-note{font-size:11px;color:#6B7280;font-style:italic;padding:6px 14px 8px;background:#F0FDF4;border-top:1px solid rgba(0,0,0,.06)}
.forms-section{border-radius:10px;overflow:hidden;margin:8px 0;border:1px solid rgba(0,0,0,.08)}
.forms-head{display:flex;align-items:center;gap:8px;padding:9px 14px;background:#7C3AED;color:#fff;font-weight:600;font-size:13px}
.forms-row{display:flex;align-items:center;gap:10px;padding:8px 14px;border-top:1px solid rgba(0,0,0,.06);font-size:12px;background:#FAF5FF}
.forms-case-link{display:inline-flex;align-items:center;gap:5px;font-weight:600;color:#5B21B6;text-decoration:none;flex:1}
.forms-case-link:hover{text-decoration:underline}
.forms-badge{font-size:11px;padding:2px 7px;border-radius:10px;background:#7C3AED;color:#fff;font-weight:600}
.notes-section{border-radius:10px;overflow:hidden;margin:8px 0;border:1px solid rgba(0,0,0,.08)}
.notes-head{display:flex;align-items:center;gap:8px;padding:9px 14px;background:#2563EB;color:#fff;font-weight:600;font-size:13px}
.notes-row{display:flex;align-items:center;gap:10px;padding:8px 14px;border-top:1px solid rgba(0,0,0,.06);font-size:12px;background:#EFF6FF}
.notes-case-link{display:inline-flex;align-items:center;gap:5px;font-weight:600;color:#1E40AF;text-decoration:none;flex:1}
.notes-case-link:hover{text-decoration:underline}
.notes-age{font-size:11px;color:#DC2626;font-weight:700}
.notes-count{font-size:11px;padding:2px 7px;border-radius:10px;background:#2563EB;color:#fff;font-weight:600}


/* AML check rows */
/* Override .case-row base (flex-row, span{flex:1}, i{margin-top}) for column layout */
.aml-row { flex-direction: column !important; align-items: stretch !important; gap: 4px; padding: 10px 14px 10px 16px; border-left: 3px solid #DC2626; background: #FFF5F5; }
.aml-row.flag-med  { border-left-color: #D97706; background: #FFFBEB; }
.aml-row.flag-info { border-left-color: #3B82F6; background: #EFF6FF; }
/* Line 1: icon + title + days + button */
.aml-title-row { display: flex !important; align-items: center; gap: 7px; flex-wrap: wrap; width: 100%; }
.aml-title-row > i { flex-shrink: 0; font-size: 12px; color: #DC2626; margin-top: 0 !important; }
.aml-row.flag-med  .aml-title-row > i { color: #D97706; }
.aml-row.flag-info .aml-title-row > i { color: #3B82F6; }
.aml-title { font-size: 13px; font-weight: 700; color: #111; flex: 1 !important; min-width: 0; }
.aml-days { font-size: 11px; color: #888; font-weight: 400; white-space: nowrap; flex: 0 !important; }
.aml-open-link { font-size: 11px; font-weight: 700; color: #fff; background: #c0392b; text-decoration: none; white-space: nowrap; border-radius: 4px; padding: 3px 10px; flex-shrink: 0; flex: 0 !important; }
.aml-open-link:hover { background: #a93226; }
.aml-row.flag-med  .aml-open-link { background: #D97706; }
.aml-row.flag-med  .aml-open-link:hover { background: #b45309; }
.aml-row.flag-info .aml-open-link { background: #3B82F6; }
.aml-row.flag-info .aml-open-link:hover { background: #2563eb; }
/* Line 2: check type */
.aml-type-row { font-size: 11.5px; color: #555; padding-left: 19px; display: flex !important; align-items: center; gap: 5px; width: 100%; }
.aml-type-row i { font-size: 11px; color: #888; margin-top: 0 !important; }
/* Line 3: failed components + screener ref */
.aml-meta-row { display: flex !important; align-items: center; gap: 8px; flex-wrap: wrap; padding-left: 19px; margin-top: 1px; width: 100%; }
.aml-meta-row i { margin-top: 0 !important; }
.aml-comp-fail { display: inline-flex; align-items: center; gap: 4px; background: #fdecea; border: 1px solid #fca5a5; border-radius: 3px; padding: 2px 7px; font-size: 11px; font-weight: 600; color: #b91c1c; flex: 0 !important; }
.aml-comp-pass { display: inline-flex; align-items: center; gap: 4px; color: #16a34a; font-size: 11px; flex: 0 !important; }
.aml-screener-ref { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #6b7280; flex: 0 !important; }
.aml-screener-ref code { background: #f3f4f6; padding: 1px 5px; border-radius: 3px; font-size: 10px; letter-spacing: .3px; }

/* ── Pinned Case Panel (rendered as first chat message) ──────────────────── */
.pinned-panel-content {
    border-left: 4px solid #09518C !important;
    background: #F8FAFC !important;
    border-radius: 0 12px 12px 12px !important;
    padding: 14px 16px !important;
    width: 100% !important;
}
#message.bot:has(.pinned-panel-content) {
    max-width: 100%;
}
