/* ==========================================================================
   Sample client analytics app — full-viewport shell (Project Royal pattern):
   navy sidebar with tab nav, main pane scrolls internally, page never
   scrolls. Extends the 4c token system; data in UI sans + tabular figures.
   ========================================================================== */

/* ---- page lock: the app owns the viewport ---- */
body.dash-app { height: 100dvh; overflow: hidden; }
body.dash-app #dash-root, .app { height: 100dvh; }

.app { display: flex; width: 100%; font-family: var(--bp-font); color: var(--bp-text); }
.app .num, .app .kpi-val, .app table td.n, .app svg text, .app .uval, .app .hm-avg { font-variant-numeric: tabular-nums; }

/* ---- sidebar ---- */
.side { width: 208px; flex-shrink: 0; background: var(--bp-navy); color: #fff; display: flex; flex-direction: column; }
.side-brand { display: block; padding: 18px 20px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.side-brand img { height: 20px; width: auto; }
.side-co { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.side-mark { width: 32px; height: 32px; padding: 5px; flex-shrink: 0; background: var(--bp-blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.side-co b { display: block; font-size: 13.5px; font-weight: 700; line-height: 1.25; }
.side-co span { font-size: 11px; color: rgba(255,255,255,0.5); }
.side-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.side-nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-left: 2px solid transparent; color: rgba(255,255,255,0.66); font-family: var(--bp-font); font-size: 13px; font-weight: 600; padding: 9px 11px; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.side-nav button svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.side-nav button:hover { color: #fff; background: rgba(255,255,255,0.05); }
.side-nav button.on { color: #fff; background: rgba(47,72,168,0.45); border-left-color: var(--bp-blue-light); }
.side-foot { padding: 16px 22px 20px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; gap: 10px; }
.side-tag { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--bp-blue-light); }
.side-foot a { font-size: 12px; color: rgba(255,255,255,0.55); transition: color 0.15s ease; }
.side-foot a:hover { color: #fff; }
.m-menu-btn { display: none; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0; background: none; border: 1px solid rgba(255,255,255,0.25); color: #fff; cursor: pointer; padding: 0; }
.m-menu-btn svg { width: 18px; height: 18px; }
.m-backdrop { position: fixed; inset: 0; z-index: 55; }
.m-dropdown { position: absolute; top: calc(100% - 6px); left: 10px; z-index: 60; width: 216px; background: var(--bp-navy); border: 1px solid rgba(255,255,255,0.14); box-shadow: 0 14px 36px rgba(13,27,46,0.35); padding: 6px; display: flex; flex-direction: column; }
.m-dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; color: rgba(255,255,255,0.72); font-family: var(--bp-font); font-size: 13px; font-weight: 600; padding: 10px 11px; cursor: pointer; }
.m-dropdown button svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.m-dropdown button.on { color: #fff; background: rgba(47,72,168,0.5); }
.m-dropdown button:hover { color: #fff; background: rgba(255,255,255,0.06); }
.m-dropdown a { font-size: 12px; color: rgba(255,255,255,0.55); padding: 10px 11px 8px; border-top: 1px solid rgba(255,255,255,0.12); margin-top: 4px; }

/* ---- main pane ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bp-blue-wash); }
.main-head { background: #fff; border-bottom: 1px solid var(--bp-line); padding: 9px 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px 28px; flex-wrap: wrap; }
.mh-title h1 { font-family: var(--bp-font); font-size: 18px; font-weight: 700; color: var(--bp-navy); line-height: 1.2; }
.mh-title p { font-size: 11.5px; color: var(--bp-text-secondary); margin-top: 1px; }
.mh-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.main-scroll { flex: 1; overflow-y: auto; padding: 14px 18px 22px; overflow-anchor: none; scrollbar-gutter: stable; }

/* ---- filters ---- */
.seg { display: inline-flex; border: 1px solid var(--bp-line); background: #fff; }
.seg button { font-family: var(--bp-font); font-size: 12px; font-weight: 600; padding: 6px 11px; color: var(--bp-text-secondary); background: none; border: 0; border-left: 1px solid var(--bp-line); cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--bp-blue); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--bp-font); font-size: 11.5px; font-weight: 600; color: var(--bp-text-secondary); background: #fff; border: 1px solid var(--bp-line); border-radius: 0; padding: 6px 9px; cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease; }
.chip:hover { border-color: var(--bp-blue); }
.chip.on { color: var(--bp-navy); border-color: var(--bp-line-strong); }
.chip-dot { width: 9px; height: 9px; flex-shrink: 0; }
.chip--all { font-weight: 700; }
.chip--all.on { background: var(--bp-navy); color: #fff; border-color: var(--bp-navy); }

/* ---- KPI tiles ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 10px; }
.kpi-grid.k3 { grid-template-columns: repeat(3, 1fr); }
.kpi { background: #fff; border: 1px solid var(--bp-line); padding: 11px 13px; }
.kpi-lbl { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bp-text-secondary); font-weight: 700; }
.kpi-val { font-size: clamp(22px, 1.8vw, 28px); font-weight: 700; color: var(--bp-navy); margin: 6px 0 4px; line-height: 1; }
.kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; }
.kpi-delta.up { color: #0a7d0a; }
.kpi-delta.down { color: #cb3b3b; }
.kpi-delta .cap { color: var(--bp-text-secondary); font-weight: 500; }
.kpi-delta svg { width: 12px; height: 12px; }

/* ---- layout grids & cards ---- */
.grid { display: grid; gap: 10px; margin-bottom: 10px; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-21 { grid-template-columns: 2fr 1fr; }
.card { background: #fff; border: 1px solid var(--bp-line); padding: 13px 15px 12px; min-width: 0; }
.card--wide { margin-bottom: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin-bottom: 4px; flex-wrap: wrap; }
.card-title { font-size: 16px; font-weight: 700; color: var(--bp-navy); letter-spacing: -0.01em; }
.card-sub { font-size: 12px; color: var(--bp-text-secondary); margin-top: 2px; }
.legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--bp-text-muted); font-weight: 500; }
.legend .swatch { width: 11px; height: 11px; flex-shrink: 0; }

/* ---- charts ---- */
.chart { position: relative; margin-top: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart svg text { fill: #647082; font-size: 11px; }
.gridline { stroke: #dbe5f3; stroke-width: 1; }
.axisline { stroke: var(--bp-line-strong); stroke-width: 1; }
.dataline { fill: none; stroke: #2f48a8; stroke-width: 2; }
.dot { fill: #2f48a8; stroke: #fff; stroke-width: 1.5; opacity: 0; }
.hit { fill: transparent; cursor: default; }
.chart g:hover .dot { opacity: 1; }

/* ---- tooltip ---- */
.viz-tip { position: absolute; z-index: 20; pointer-events: none; background: #fff; border: 1px solid var(--bp-line-strong); box-shadow: 0 8px 24px rgba(13,27,46,0.14); padding: 8px 11px; font-size: 12.5px; color: var(--bp-navy); white-space: nowrap; transform: translate(-50%, -118%); opacity: 0; transition: opacity 0.1s ease; }
.viz-tip.on { opacity: 1; }
.viz-tip .t-lbl { color: var(--bp-text-secondary); font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 3px; }
.viz-tip .t-row { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.viz-tip .t-row.sub { font-weight: 500; color: var(--bp-text-muted); }
.viz-tip .t-row .sw { width: 9px; height: 9px; flex-shrink: 0; }
.viz-tip .t-val { margin-left: auto; padding-left: 16px; font-variant-numeric: tabular-nums; }

/* ---- tables ---- */
.dash-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.dash-table th { text-align: left; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bp-text-secondary); font-weight: 700; padding: 0 16px 7px 0; border-bottom: 1px solid var(--bp-line-strong); white-space: nowrap; }
.dash-table th.n, .dash-table td.n { text-align: right; padding-right: 28px; }
.dash-table th.n:last-child, .dash-table td.n:last-child { padding-right: 0; }
.dash-table th.s { cursor: pointer; user-select: none; }
.dash-table th.s:hover { color: var(--bp-blue); }
.dash-table td { padding: 7px 16px 7px 0; border-bottom: 1px solid var(--bp-line); font-size: 12.5px; color: var(--bp-navy); }
.dash-table td.co { font-weight: 600; }
.line-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; vertical-align: middle; }
.dash-table .share { display: inline-block; width: 90px; height: 6px; background: var(--bp-blue-pale); position: relative; vertical-align: middle; }
.dash-table .share i { position: absolute; left: 0; top: 0; bottom: 0; background: #2f48a8; max-width: 100%; }
.chg { font-weight: 600; }
.chg.up { color: #0a7d0a; }
.chg.down { color: #cb3b3b; }

/* utilization / consumed bars */
.util-col { width: 160px; white-space: nowrap; }
.ubar { display: inline-block; width: 92px; height: 8px; background: var(--bp-blue-pale); vertical-align: middle; position: relative; }
.ubar i { position: absolute; left: 0; top: 0; bottom: 0; background: #2f48a8; }
.ubar i.u-good { background: #0a7d0a; }
.ubar i.u-low { background: #cb3b3b; }
.uval { display: inline-block; margin-left: 8px; font-weight: 600; color: var(--bp-navy); font-size: 12px; }

/* status chips (icon dot + label, never color alone) */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border: 1px solid; white-space: nowrap; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-ok   { color: #0a7d0a; border-color: #bfe3bf; background: #f0faf0; }
.st-risk { color: #b45309; border-color: #f0d9b8; background: #fdf6ea; }
.st-done { color: #46536a; border-color: var(--bp-line); background: var(--bp-blue-wash); }
.st-hold { color: #647082; border-color: var(--bp-line); background: #fff; }

/* ---- utilization heatmap ---- */
.hm-wrap { position: relative; margin-top: 14px; }
.hm { display: grid; gap: 3px; }
.hm-h { font-size: 9.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--bp-text-secondary); font-weight: 700; text-align: center; padding-bottom: 4px; }
.hm-h.hm-r { text-align: right; }
.hm-name { font-size: 11.5px; font-weight: 600; color: var(--bp-navy); padding-right: 12px; line-height: 1.2; align-self: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-name span { display: block; font-size: 9.5px; font-weight: 500; color: var(--bp-text-secondary); }
.hm-cell { height: 22px; cursor: default; }
.hm-cell:hover { outline: 2px solid var(--bp-navy); outline-offset: -2px; }
.hm-avg { font-size: 11.5px; font-weight: 700; color: var(--bp-navy); text-align: right; align-self: center; }
.hm-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 9px; font-size: 10.5px; align-items: center; color: var(--bp-text-muted); font-weight: 500; }
.hm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hm-legend i { width: 12px; height: 12px; }

.dash-foot { margin-top: 12px; font-size: 11px; color: var(--bp-text-secondary); }

/* ---- focus mode (Power BI-style visual expand) ---- */
.card-tools { display: flex; align-items: center; gap: 12px; }
.card-focus { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; background: none; border: 0; color: var(--bp-text-secondary); cursor: pointer; opacity: 0; transition: opacity 0.15s ease, color 0.15s ease; }
.card-focus svg { width: 14px; height: 14px; }
.card:hover .card-focus, .modal-card .card-focus { opacity: 1; }
.card-focus:hover { color: var(--bp-blue); }
@media (hover: none) { .card-focus { opacity: 0.55; } }
.modal-back { position: fixed; inset: 0; background: #fff; z-index: 120; }
.modal-card { width: 100%; height: 100%; overflow: auto; padding: 12px 28px 24px; }
.modal-return { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--bp-blue); font-family: var(--bp-font); font-size: 13px; font-weight: 600; cursor: pointer; padding: 8px 0 10px; }
.modal-return:hover { text-decoration: underline; }
.modal-head { margin-bottom: 10px; align-items: center; }
.modal-head .card-title { font-size: 18px; }
.mh-right { display: flex; align-items: center; gap: 18px; }
.modal-actions { display: flex; gap: 8px; }
.modal-actions button { font-family: var(--bp-font); font-size: 12px; font-weight: 600; color: var(--bp-blue); background: none; border: 1px solid var(--bp-line-strong); padding: 6px 13px; cursor: pointer; min-width: 104px; }
.modal-actions button:hover { border-color: var(--bp-blue); }
.modal-card .chart svg { max-height: calc(100dvh - 190px); }
.modal-zoom { margin-top: 4px; }
@media (min-width: 1200px) {
    .modal-zoom { zoom: 1.4; }
    .modal-zoom .chart svg { max-height: calc((100dvh - 210px) / 1.4); }
}
@media (min-width: 981px) and (max-width: 1199px) { .modal-zoom { zoom: 1.15; } }
@media (max-width: 980px) { .modal-card { padding: 8px 14px 16px; } }
.art-focus-wrap { position: relative; }
.art-focus-btn { position: absolute; top: 7px; right: 7px; z-index: 6; }
.art-focus-wrap:hover .art-focus-btn { opacity: 1; }

/* ---- AI insights strip (summary tab) ---- */
.ins-card { background: #fff; border: 1px solid var(--bp-line); padding: 10px 15px 12px; margin-bottom: 10px; }
.ins-head { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--bp-blue); margin-bottom: 9px; }
.ins-head svg { width: 13px; height: 13px; }
.ins-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ins-item { font-size: 14.5px; line-height: 1.55; color: var(--bp-text); border-left: 2px solid var(--bp-blue-light); padding-left: 11px; min-height: 40px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ins-skel i { display: block; height: 11px; margin: 4px 0 7px; background: linear-gradient(90deg, var(--bp-blue-pale) 25%, #f6f9fe 45%, var(--bp-blue-pale) 65%); background-size: 200% 100%; animation: insShimmer 1.4s linear infinite; }
.ins-skel i:last-child { width: 70%; }
@keyframes insShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---- responsive ---- */
@media (max-width: 1180px) {
    .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
    body.dash-app { height: auto; overflow: auto; }
    body.dash-app #dash-root, .app { height: auto; min-height: 100dvh; }
    .app { flex-direction: column; }
    .main-scroll { overflow: visible; }
    .card { overflow-x: auto; }
    .ins-grid { grid-template-columns: 1fr; gap: 10px; }
    .ins-item { min-height: 0; }
    .hm-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .hm-wrap .hm { min-width: 640px; }
    .side { width: 100%; flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; position: sticky; top: 0; z-index: 45; }
    .m-menu-btn { display: flex; }
    .side-brand { border-bottom: 0; padding: 0; margin-left: auto; flex-shrink: 0; order: 2; }
    .side-brand img { height: 17px; }
    .side-co { display: flex; border-bottom: 0; padding: 0; min-width: 0; order: 1; }
    .side-co b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .side-mark { width: 26px; height: 26px; padding: 4px; }
    .side-nav, .side-foot { display: none; }
    .g-2, .g-21 { grid-template-columns: 1fr; }
    .main-scroll { padding: 16px; }
    .main-head { padding: 12px 16px; }
}
@media (max-width: 640px) {
    .kpi-grid, .kpi-grid.k3 { grid-template-columns: repeat(2, 1fr); }
    .chips { display: none; }                                 /* click charts to filter */
    .util-col { width: auto; }
    .ubar { width: 56px; }
    .hm-cell { height: 22px; }
    .dash-table th:nth-child(2), .dash-table td:nth-child(2) { display: none; }
}

/* ---- interactive affordances ---- */
.seg-click { cursor: pointer; }
.lg-click { cursor: pointer; }
.lg-click:hover { color: var(--bp-blue); }
.row-click { cursor: pointer; }
.row-click:hover td { background: var(--bp-blue-pale); }
tr.sel td { background: var(--bp-blue-pale); }
.chip-client { border-color: var(--bp-navy); color: var(--bp-navy); font-weight: 700; }
.clear-btn { font-family: var(--bp-font); font-size: 11.5px; font-weight: 700; color: #fff; background: var(--bp-navy); border: 1px solid var(--bp-navy); padding: 6px 11px; cursor: pointer; white-space: nowrap; }
.clear-btn:hover { background: var(--bp-blue); border-color: var(--bp-blue); }
.side-mark svg { width: 100%; height: 100%; display: block; }

/* ---- fit-to-page wrapper & cell filters ---- */
.fit-wrap { width: 100%; display: flex; flex-direction: column; }
.fit-wrap > div { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.grid.grow { flex: 1; min-height: 0; }
.grid.grow > .card { display: flex; flex-direction: column; min-height: 0; }
.grid.grow > .card .chart.fill { flex: 1; min-height: 0; }
.modal-zoom .chart.fill { height: min(62vh, 680px); }
td.cell-click { cursor: pointer; }
td.cell-click:hover { color: var(--bp-blue); background: var(--bp-blue-pale); }

/* ---- AI analyst drawer ---- */
.side-ai { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; margin-top: auto; background: rgba(169,200,245,0.08); border: 1px solid rgba(169,200,245,0.25); border-left: 2px solid transparent; color: #a9c8f5; font-family: var(--bp-font); font-size: 13px; font-weight: 700; padding: 10px 11px; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.side-ai svg { width: 16px; height: 16px; flex-shrink: 0; }
.side-ai:hover { background: rgba(169,200,245,0.16); color: #fff; }
.side-ai.on { background: var(--bp-blue); border-color: var(--bp-blue); color: #fff; }
.ai-badge { margin-left: auto; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; background: rgba(255,255,255,0.14); padding: 2px 6px; font-weight: 700; }

.ai-drawer { width: 400px; flex-shrink: 0; background: #fff; border-left: 1px solid var(--bp-line); display: flex; flex-direction: column; min-width: 0; position: relative; }
.ai-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 9px; cursor: col-resize; z-index: 5; touch-action: none; }
.ai-resize:hover, .ai-resize:active { background: linear-gradient(90deg, transparent 3px, var(--bp-blue) 3px, var(--bp-blue) 5px, transparent 5px); }
.ai-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--bp-line); }
.ai-title { font-size: 15px; font-weight: 700; color: var(--bp-navy); }
.ai-sub { font-size: 11.5px; color: var(--bp-text-secondary); }
.ai-close { background: none; border: 0; font-size: 15px; color: var(--bp-text-secondary); cursor: pointer; padding: 6px; }
.ai-close:hover { color: var(--bp-navy); }

.ai-msgs { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 10px; background: var(--bp-blue-wash); }
.ai-empty { font-size: 13px; color: var(--bp-text-muted); display: flex; flex-direction: column; gap: 8px; }
.ai-empty p { margin-bottom: 4px; line-height: 1.6; }
.ai-chip { text-align: left; font-family: var(--bp-font); font-size: 12.5px; font-weight: 600; color: var(--bp-blue); background: #fff; border: 1px solid var(--bp-line); padding: 9px 12px; cursor: pointer; transition: border-color 0.15s ease; }
.ai-chip:hover { border-color: var(--bp-blue); }

.ai-msg { max-width: 92%; font-size: 13.5px; line-height: 1.6; }
.ai-user { align-self: flex-end; background: var(--bp-blue); color: #fff; padding: 9px 13px; }
.ai-bot { align-self: flex-start; width: 92%; }
.ai-text { background: #fff; border: 1px solid var(--bp-line); padding: 10px 13px; color: var(--bp-text); }
.ai-text + .ai-text, .ai-art + .ai-text, .ai-text + .ai-art, .ai-art + .ai-art { margin-top: 8px; }
.ai-text code { background: var(--bp-blue-pale); padding: 1px 5px; font-size: 12px; }
.ai-li { padding-left: 14px; position: relative; }
.ai-li::before { content: ''; position: absolute; left: 2px; top: 9px; width: 5px; height: 5px; background: var(--bp-blue); }

.ai-art { background: #fff; border: 1px solid var(--bp-line); padding: 12px 14px; }
.ai-art-title { font-size: 12.5px; font-weight: 700; color: var(--bp-navy); margin-bottom: 6px; }
.ai-art svg { display: block; width: 100%; height: auto; }
.ai-art svg text { fill: #647082; font-size: 11px; }
.ai-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.ai-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--bp-text-muted); font-weight: 500; }
.ai-legend i { width: 10px; height: 10px; }
.ai-table td, .ai-table th { font-size: 12px; padding-right: 10px; }

.ai-typing { background: #fff; border: 1px solid var(--bp-line); padding: 12px 16px; display: inline-flex; gap: 5px; width: auto; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--bp-blue); opacity: 0.35; animation: aiTyping 1.1s infinite; }
.ai-typing i:nth-child(2) { animation-delay: 0.18s; }
.ai-typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes aiTyping { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.ai-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--bp-line); }
.ai-input input { flex: 1; font-family: var(--bp-font); font-size: 13.5px; padding: 10px 12px; border: 1px solid var(--bp-line); background: var(--bp-blue-wash); border-radius: 0; }
.ai-input input:focus { outline: none; border-color: var(--bp-blue); }
.ai-input button { font-family: var(--bp-font); font-size: 13px; font-weight: 700; color: #fff; background: var(--bp-blue); border: 0; padding: 10px 16px; cursor: pointer; }
.ai-input button:disabled { opacity: 0.5; cursor: default; }
.ai-input button:not(:disabled):hover { background: var(--bp-blue-dark); }
.ai-foot { font-size: 10.5px; color: var(--bp-text-secondary); text-align: center; padding: 6px 12px 10px; }

@media (max-width: 1180px) {
    .ai-drawer { position: fixed; right: 0; top: 0; bottom: 0; z-index: 50; width: min(400px, 92vw); box-shadow: -12px 0 40px rgba(13,27,46,0.18); }
}
