/* v13 additions: dashboard KPIs, charts, assistant */
.hero-strip{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:1.1rem}
.hero-strip .hello{font-size:1.5rem;margin:.1rem 0}
.hero-actions{display:flex;gap:.5rem;flex-wrap:wrap}
.kpis{margin-bottom:1.1rem}
.kpi{position:relative;overflow:hidden;padding:1.1rem 1.2rem}
.kpi-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:.8rem}
.kpi .ic{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;color:#fff}
.kpi .ic svg{width:20px;height:20px}
.kpi.c1 .ic{background:linear-gradient(135deg,#5b4bf5,#8b5cf6)}.kpi.c2 .ic{background:linear-gradient(135deg,#f43f8e,#fb923c)}
.kpi.c3 .ic{background:linear-gradient(135deg,#14b8a6,#38bdf8)}.kpi.c4 .ic{background:linear-gradient(135deg,#fbbf24,#fb7185)}
.kpi .n{font-family:var(--font-h);font-size:2.1rem;font-weight:800;line-height:1;letter-spacing:-.03em}
.kpi .l{font-size:12px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:600;margin-top:.45rem}
.kpi .s{font-size:.82rem;color:var(--muted);margin-top:.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chip{font-size:.75rem;font-weight:700;padding:.2rem .55rem;border-radius:99px}
.chip.up{background:#dcfce7;color:#15803d}.chip.down{background:#ffe4e6;color:#be123c}.chip.flat{background:#eef;color:#555a85}
.card-head{display:flex;justify-content:space-between;align-items:baseline;gap:.6rem;margin-bottom:.7rem}
.card-head h2{margin:0;display:flex;align-items:center;gap:.4rem}.card-head h2 svg{width:18px;height:18px;color:var(--brand)}
.card-head a{font-size:.85rem}
.chart{width:100%;height:auto;display:block}
.chart .grid{stroke:var(--line);stroke-width:1}.chart .ax{fill:var(--muted);font-size:10px}
.chart .bm{fill:#5b4bf5}.chart .bv{fill:#f43f8e}.chart .ln{fill:none;stroke:#5b4bf5;stroke-width:2.5;stroke-linejoin:round}
.chart .area{fill:rgba(91,75,245,.12)}.chart .dot{fill:#fff;stroke:#5b4bf5;stroke-width:2}
.legend{display:flex;gap:1rem;font-size:.8rem;color:var(--muted);margin-top:.4rem}
.legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:.35rem}.legend .lm{background:#5b4bf5}.legend .lv{background:#f43f8e}
.hbars{display:grid;gap:.8rem}.hb-top{display:flex;justify-content:space-between;gap:.5rem;font-size:.9rem}.hb-note{font-size:.78rem}
.bar{height:8px;border-radius:99px;background:var(--line);overflow:hidden}.bar>span{display:block;height:100%;border-radius:99px;background:var(--grad)}
.row-line{display:flex;justify-content:space-between;gap:.6rem;padding:.45rem 0;border-bottom:1px solid var(--line);font-size:.92rem}
.live-nums{display:grid;grid-template-columns:repeat(3,1fr);gap:.6rem;margin:.6rem 0 1rem}
.live-nums div{background:var(--bg);border-radius:14px;padding:.7rem;text-align:center}.live-nums b{display:block;font-size:1.5rem;font-family:var(--font-h)}.live-nums span{font-size:.75rem;color:var(--muted)}
.live-pill{font-size:.78rem;font-weight:700;color:#15803d;display:inline-flex;align-items:center;gap:.35rem}.live-pill i{width:8px;height:8px;border-radius:50%;background:#22c55e;animation:pulse 1.6s infinite}
@keyframes pulse{50%{opacity:.35}}
.onboard ol{margin:.6rem 0 0;padding-left:1.2rem;display:grid;gap:.5rem}
.ask-form,.filters{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}.ask-form input{flex:1;min-width:200px}
.filters{margin-bottom:1rem}.filters .inl{display:flex;align-items:center;gap:.4rem;margin:0}.filters input{width:auto}
.chk{display:flex;gap:.6rem;align-items:flex-start;font-weight:500}.chk input{width:auto;min-height:0;margin-top:.25rem}
/* assistant: fixed-height chat, log scrolls inside, input stays at the bottom */
.chat{display:flex;flex-direction:column;gap:.6rem;max-width:860px;height:calc(100dvh - 9.5rem);min-height:380px;padding:.8rem}
.chat-log{display:grid;gap:.7rem;align-content:start;flex:1 1 auto;min-height:0;overflow-y:auto;padding:.2rem;overscroll-behavior:contain}
.chat-bottom{flex:0 0 auto;display:grid;gap:.5rem}
.msg{display:flex}.msg.me{justify-content:flex-end}.msg .bubble{max-width:92%;padding:.7rem .95rem;border-radius:16px;white-space:pre-line;font-size:.94rem}
.msg.bot .bubble{background:var(--bg);border-top-left-radius:4px}.msg.me .bubble{background:var(--grad);color:#fff;border-top-right-radius:4px}
.msg.bot{flex-direction:column;align-items:flex-start}
.mini-table{overflow-x:auto;margin-top:.5rem;max-width:100%}.mini-table table{font-size:.82rem;background:#fff;border-radius:10px}.mini-table th,.mini-table td{padding:.45rem .6rem}
.links{display:flex;gap:.4rem;flex-wrap:wrap;margin-top:.4rem}.links a{font-size:.8rem;background:#fff;border:1px solid var(--line);border-radius:99px;padding:.15rem .6rem;text-decoration:none;color:var(--brand)}
.src{font-size:.74rem;color:var(--muted);margin-top:.3rem}
.chips{display:flex;gap:.45rem;flex-wrap:nowrap;overflow-x:auto;padding-bottom:.2rem;scrollbar-width:none}.chips::-webkit-scrollbar{display:none}.chip-btn{flex:0 0 auto;white-space:nowrap;border:1px solid var(--line);background:#fff;color:var(--brand);border-radius:99px;padding:.4rem .8rem;font-size:.82rem;font-weight:600}
.chat-form{display:flex;gap:.5rem}.chat-form input{flex:1;min-width:0}.chat-note{font-size:.78rem;margin:0}.chat-note summary{cursor:pointer;color:var(--muted)}.chat-note p{margin:.3rem 0 0}
@media(max-width:640px){.hero-strip .hello{font-size:1.25rem}.kpi .n{font-size:1.7rem}.msg .bubble{max-width:100%}}

@media(max-width:640px){.chat{height:calc(100dvh - 8rem);padding:.6rem;border-radius:16px}}

/* floating assistant (all pages) */
.aw-fab{position:fixed;right:max(1rem,env(safe-area-inset-right));bottom:max(1rem,env(safe-area-inset-bottom));z-index:60;display:flex;align-items:center;gap:.4rem;height:52px;padding:0 1.1rem;border:0;border-radius:99px;background:var(--grad);color:#fff;font-weight:700;box-shadow:0 14px 30px -10px rgba(91,75,245,.7)}
.aw-fab svg{width:20px;height:20px}.aw-fab.on{display:none}
.aw-panel{position:fixed;z-index:70;right:max(1rem,env(safe-area-inset-right));bottom:max(1rem,env(safe-area-inset-bottom));width:380px;max-width:calc(100vw - 2rem);height:min(560px,calc(100dvh - 2rem));display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:0 24px 60px -20px rgba(18,19,43,.45);overflow:hidden}
.aw-panel[hidden]{display:none}
.aw-panel header{display:flex;justify-content:space-between;align-items:center;padding:.75rem 1rem;background:var(--grad);color:#fff}
.aw-panel header button{background:rgba(255,255,255,.2);border:0;color:#fff;width:32px;height:32px;border-radius:50%;font-size:1rem}
.aw-log{flex:1 1 auto;min-height:0;overflow-y:auto;display:grid;align-content:start;gap:.6rem;padding:.8rem;overscroll-behavior:contain}
.aw-log .msg .bubble{font-size:.9rem}
.aw-chips{display:flex;gap:.4rem;overflow-x:auto;padding:0 .8rem .5rem;scrollbar-width:none}.aw-chips::-webkit-scrollbar{display:none}.aw-chips[hidden]{display:none}
.aw-chips button{flex:0 0 auto;white-space:nowrap;border:1px solid var(--line);background:#fff;color:var(--brand);border-radius:99px;padding:.35rem .7rem;font-size:.8rem;font-weight:600}
.aw-form{display:flex;gap:.5rem;padding:.6rem .8rem;border-top:1px solid var(--line)}.aw-form input{flex:1;min-width:0}
@media(max-width:640px){.aw-panel{right:0;left:0;bottom:0;width:100%;max-width:100%;height:78dvh;border-radius:20px 20px 0 0}.aw-fab{bottom:max(.9rem,env(safe-area-inset-bottom))}.aw-fab span{display:none}.aw-fab{width:52px;padding:0;justify-content:center}}
@media print{.aw-fab,.aw-panel{display:none!important}}
