/* CloudMobile Chatbot dashboard. One stylesheet, no dependencies. */
:root {
  --bg: #f3f5f4; --surface: #fff; --surface-2: #f8faf9; --line: #e2e8e5; --line-strong: #cfd8d4;
  --text: #15201d; --muted: #5d6b67; --faint: #8a9793;
  --brand: #0f766e; --brand-600: #0d6b64; --brand-50: #e7f5f3; --brand-100: #ccebe6;
  --ink: #0d1b19; --ink-2: #14282a; --ink-text: #b9c9c5; --ink-active: rgba(255,255,255,.09);
  --ok: #067647; --ok-bg: #e6f6ee; --warn: #a15c07; --warn-bg: #fdf3dc; --bad: #b42318; --bad-bg: #fdecea;
  --info: #175cd3; --info-bg: #e8f0fd;
  --radius: 10px; --radius-sm: 7px; --shadow: 0 1px 2px rgba(16,24,20,.06), 0 1px 3px rgba(16,24,20,.05);
  --shadow-lg: 0 12px 32px rgba(10,20,18,.18); --sidebar: 252px; --sidebar-collapsed: 68px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.sm { width: 15px; height: 15px; } .icon.lg { width: 22px; height: 22px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; }
.right { margin-left: auto; } .grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .stack { display: flex; flex-direction: column; gap: 14px; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; transition: grid-template-columns .18s ease; }
.app.collapsed { grid-template-columns: var(--sidebar-collapsed) 1fr; }
.sidebar { background: var(--ink); color: var(--ink-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; color: #fff; font-weight: 650; letter-spacing: .2px; }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #14b8a6, #0f766e); display: grid; place-items: center; flex: none; }
.brand .logo .icon { width: 18px; height: 18px; stroke: #fff; }
.brand small { display: block; font-weight: 500; color: #7f9993; font-size: 11.5px; letter-spacing: 0; }
.workspace { margin: 4px 12px 10px; padding: 9px 10px; border-radius: var(--radius-sm); background: var(--ink-2); border: 1px solid rgba(255,255,255,.06); }
.workspace label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: #7f9993; margin-bottom: 3px; }
.workspace select { width: 100%; background: transparent; border: 0; color: #fff; font-weight: 600; cursor: pointer; padding: 0; text-overflow: ellipsis; }
.workspace select option { color: #111; } .workspace .name { color: #fff; font-weight: 600; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.nav h6 { margin: 14px 8px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; color: #6f8781; font-weight: 600; white-space: nowrap; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin-bottom: 2px; border-radius: 8px; color: var(--ink-text); font-weight: 500; white-space: nowrap; position: relative; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.nav a[aria-current="page"] { background: var(--ink-active); color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #2dd4bf; }
.nav .count { margin-left: auto; background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; min-width: 18px; text-align: center; line-height: 18px; }
.side-foot { padding: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.usermenu { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; text-align: left; padding: 7px 8px; border-radius: 8px; color: #fff; cursor: pointer; }
.usermenu:hover { background: rgba(255,255,255,.06); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #1f4a45; color: #a7f3e7; display: grid; place-items: center; font-weight: 650; flex: none; font-size: 13px; }
.usermenu .who { min-width: 0; line-height: 1.25; } .usermenu .who b { display: block; font-size: 13px; } .usermenu .who span { font-size: 11.5px; color: #86a09a; }
.collapse-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 4px; padding: 7px 8px; background: none; border: 0; color: #86a09a; cursor: pointer; border-radius: 8px; font-size: 12.5px; }
.collapse-btn:hover { color: #fff; background: rgba(255,255,255,.05); }
.app.collapsed .brand > div:not(.logo), .app.collapsed .workspace, .app.collapsed .nav h6, .app.collapsed .nav a span.label,
.app.collapsed .nav .count, .app.collapsed .usermenu .who, .app.collapsed .collapse-btn span { display: none; }
.app.collapsed .nav a { justify-content: center; } .app.collapsed .nav a[aria-current="page"]::before { left: -10px; }
.app.collapsed .collapse-btn .icon { transform: rotate(180deg); } .app.collapsed .collapse-btn, .app.collapsed .usermenu { justify-content: center; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--muted); }
.iconbtn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.content { padding: 24px 28px 40px; max-width: 1280px; width: 100%; margin: 0 auto; flex: 1; }
.backdrop { display: none; }
@media (max-width: 900px) {
  .app, .app.collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .2s ease; }
  .app.collapsed .brand > div:not(.logo), .app.collapsed .workspace, .app.collapsed .nav h6, .app.collapsed .nav a span.label,
  .app.collapsed .nav .count, .app.collapsed .usermenu .who, .app.collapsed .collapse-btn span { display: revert; }
  .app.collapsed .nav a { justify-content: flex-start; } .collapse-btn { display: none; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(8,16,14,.5); z-index: 25; }
  .topbar { display: flex; } .content { padding: 18px 14px 90px; }
}

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; letter-spacing: -.2px; } .page-head p { margin: 3px 0 0; color: var(--muted); max-width: 70ch; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; } .crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--brand); }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > .card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card > .card-head h2 { font-size: 14.5px; } .card > .card-body { padding: 18px; }
.grid { display: grid; gap: 16px; } .grid.kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid.two { grid-template-columns: 2fr 1fr; } .grid.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .grid.two, .grid.even { grid-template-columns: 1fr; } }
.kpi { padding: 16px 18px; } .kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 28px; font-weight: 680; letter-spacing: -.5px; margin-top: 4px; } .kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.delta { font-weight: 600; } .delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.kpi.link { display: block; color: inherit; } .kpi.link:hover { border-color: var(--brand); text-decoration: none; }
dl.facts { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 9px 12px; } dl.facts dt { color: var(--muted); } dl.facts dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- buttons, badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 560; cursor: pointer; white-space: nowrap; line-height: 1.3; }
.btn:hover { background: var(--surface-2); text-decoration: none; } .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-600); }
.btn.danger { color: var(--bad); border-color: #f0c4be; } .btn.danger:hover { background: var(--bad-bg); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; } .btn.danger.solid:hover { background: #9a1c12; }
.btn.ghost { border-color: transparent; background: none; } .btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn .spinner { width: 14px; height: 14px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef1f0; color: #3f4d49; white-space: nowrap; line-height: 20px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); } .badge.brand { background: var(--brand-50); color: var(--brand); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 550; font-size: 13px; }
.chip:hover { background: var(--surface-2); } .chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.attention[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; } .field > label, .field > .lbl { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.field .hint { color: var(--muted); font-size: 12.5px; } .field .err { color: var(--bad); font-size: 12.5px; font-weight: 550; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
textarea { resize: vertical; min-height: 84px; line-height: 1.45; } textarea.tall { min-height: 200px; } textarea.mono { font-family: var(--mono); font-size: 12.5px; }
input:hover, select:hover, textarea:hover { border-color: #b3c1bc; } input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
input[type=color] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
input[disabled], select[disabled], textarea[disabled] { background: var(--surface-2); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; } .form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.counter { font-size: 12px; color: var(--faint); margin-left: auto; font-weight: 500; } .counter.over { color: var(--bad); font-weight: 650; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: #c5cfcb; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .track { background: var(--brand); } .switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } @media (max-width: 700px) { .choice-cards { grid-template-columns: 1fr; } }
.choice { display: flex; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.choice:hover { border-color: #9db1ab; } .choice.on { border-color: var(--brand); background: var(--brand-50); }
.choice input { margin-top: 3px; accent-color: var(--brand); } .choice b { display: block; } .choice span { color: var(--muted); font-size: 12.5px; }
.input-group { display: flex; gap: 8px; } .input-group > input { flex: 1; }
.secret { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .secret input { flex: 1; min-width: 180px; }
.subpanel { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius); padding: 16px; }
.subpanel > h4 { font-size: 13px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.code { position: relative; background: #0e1a18; color: #d3f0ea; border-radius: var(--radius-sm); padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; }
.code .btn { position: absolute; right: 8px; top: 8px; }

/* ---------- accordion (collapsible sections) ---------- */
.acc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.acc + .acc { margin-top: 12px; }
.acc > .acc-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 18px; background: none; border: 0; cursor: pointer; text-align: left; }
.acc > .acc-head:hover { background: var(--surface-2); }
.acc .acc-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex: none; }
.acc .acc-title { font-weight: 640; font-size: 14.5px; } .acc .acc-sum { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.acc > .acc-head > span:nth-child(2) { flex: 1; min-width: 0; }
.acc .chev { margin-left: 0; transition: transform .15s; color: var(--muted); } .acc.open .chev { transform: rotate(180deg); }
.acc > .acc-body { display: none; padding: 6px 18px 20px 64px; border-top: 1px solid var(--line); padding-top: 18px; } .acc.open > .acc-body { display: block; }
.acc.has-error { border-color: #f0b8b1; } .acc.has-error .acc-icon { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 700px) { .acc > .acc-body { padding-left: 18px; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; } table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; } .tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; } .tbl tbody tr.click:hover { background: var(--surface-2); }
.cell-main { font-weight: 600; } .cell-sub { color: var(--muted); font-size: 12.5px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 380px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; } .search .icon { position: absolute; left: 10px; top: 9px; color: var(--faint); }
.search input { padding-left: 34px; }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
select.pill { width: auto; padding: 3px 24px 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.stage-new { background: var(--info-bg); border-color: #bcd3f7; color: var(--info); } .stage-won { background: var(--ok-bg); border-color: #b5e2c9; color: var(--ok); }
.stage-lost { background: #f0f2f1; color: var(--muted); } .stage-contacted, .stage-quoted { background: var(--warn-bg); border-color: #f0d9a0; color: var(--warn); }

/* ---------- empty / loading / banners ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); } .empty .icon { width: 34px; height: 34px; color: var(--faint); margin-bottom: 8px; }
.empty h3 { color: var(--text); font-size: 15px; margin-bottom: 4px; } .empty p { margin: 0 auto 14px; max-width: 46ch; }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.btn.primary .spinner { border-color: rgba(255,255,255,.4); border-top-color: #fff; } @keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px 0; }
.skeleton { background: linear-gradient(90deg, #eaeeec 25%, #f4f6f5 37%, #eaeeec 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; height: 14px; } @keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; }
.banner.info { background: var(--info-bg); border-color: #c4d8f8; color: #12408f; } .banner.warn { background: var(--warn-bg); border-color: #f0d9a0; color: #6b3f05; }
.banner.bad { background: var(--bad-bg); border-color: #f0c4be; color: #7a1a12; } .banner.ok { background: var(--ok-bg); border-color: #b5e2c9; color: #045232; }
.banner .icon { margin-top: 2px; }

/* ---------- save bar ---------- */
.savebar { position: sticky; bottom: 0; z-index: 15; margin: 20px -28px -40px; padding: 12px 28px; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.savebar .state { color: var(--muted); font-size: 13px; } .savebar.dirty .state { color: var(--warn); font-weight: 600; }
@media (max-width: 900px) { .savebar { margin: 20px -14px -90px; padding: 12px 14px; } }

/* ---------- dialog, drawer, toast ---------- */
dialog { border: 0; border-radius: 14px; padding: 0; box-shadow: var(--shadow-lg); width: min(520px, calc(100vw - 28px)); max-height: calc(100vh - 40px); color: var(--text); }
dialog::backdrop { background: rgba(8,16,14,.5); } dialog.wide { width: min(680px, calc(100vw - 28px)); }
.dlg-head { padding: 18px 22px 4px; } .dlg-head h2 { font-size: 17px; } .dlg-body { padding: 10px 22px 6px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: calc(100vh - 210px); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 60; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .2s ease; }
.drawer.open { transform: none; } .drawer-veil { position: fixed; inset: 0; background: rgba(8,16,14,.4); z-index: 55; opacity: 0; transition: opacity .2s; pointer-events: none; } .drawer-veil.open { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); } .drawer-body { padding: 20px 22px 30px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 650; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.delivery { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; display: flex; gap: 12px; align-items: flex-start; } .delivery + .delivery { margin-top: 8px; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #12201d; color: #fff; padding: 11px 15px; border-radius: 9px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; max-width: 380px; animation: toast-in .18s ease; }
.toast.error { background: #7a1a12; } .toast.ok .icon { color: #5eead4; } @keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- charts, conversations ---------- */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; } .chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .bars { display: flex; gap: 2px; align-items: flex-end; width: 100%; height: 100%; justify-content: center; } .chart .bar { flex: 1; max-width: 16px; border-radius: 3px 3px 0 0; min-height: 2px; }
.chart .bar.a { background: var(--brand); } .chart .bar.b { background: #f0b429; } .chart .x { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.hbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; } .hbar .track { flex: 1; height: 8px; background: #edf1ef; border-radius: 99px; overflow: hidden; } .hbar .fill { height: 100%; background: var(--brand); border-radius: 99px; }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 0; min-height: 540px; } .split .list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 72vh; } .split .pane { display: flex; flex-direction: column; min-width: 0; }
.conv { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; cursor: pointer; } .conv:hover { background: var(--surface-2); } .conv.on { background: var(--brand-50); }
.thread { padding: 18px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 64vh; background: var(--surface-2); flex: 1; }
.msg { max-width: 76%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow); }
.msg.user { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; } .msg.assistant { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg time { display: block; font-size: 11px; opacity: .7; margin-top: 3px; }
.msg.failed { background: var(--bad-bg); color: var(--bad); border: 1px solid #f0c4be; }
.msg .delivery { font-size: 11px; font-weight: 600; margin-top: 4px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .split .list { border-right: 0; max-height: none; } .split.show-thread .list { display: none; } .split:not(.show-thread) .pane { display: none; } .msg { max-width: 90%; } }
.check { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); } .check:last-child { border-bottom: 0; } .check .badge { align-self: flex-start; min-width: 62px; justify-content: center; }
.settings-layout { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: start; } @media (max-width: 900px) { .settings-layout { grid-template-columns: 1fr; } }
.side-tabs { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; } .side-tabs a { padding: 7px 11px; border-radius: 7px; color: var(--muted); font-weight: 550; } .side-tabs a:hover { background: var(--surface); text-decoration: none; color: var(--text); }
.setting { padding: 14px 0; border-top: 1px solid var(--line); } .setting:first-child { border-top: 0; padding-top: 0; }
mark { background: #fff1b8; border-radius: 3px; padding: 0 1px; }

/* user menu popover */
.side-foot { position: relative; }
.menu { position: absolute; left: 10px; right: 10px; bottom: 58px; background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; color: var(--text); }
.menu button:hover { background: var(--surface-2); }
.app.collapsed .menu { left: 6px; right: auto; width: 190px; }
