/* Smart Nutrition — WhatsApp agent dashboard. Identity follows the POS system. */
:root {
  --ink: #0c3337;
  --ink-2: #134a4f;
  --ink-3: #1c5a60;
  --brand: #04767b;
  --brand-dark: #035c60;
  --mint: #e3f0ee;
  --mint-2: #cfe5e2;
  --accent: #e79800;
  --accent-2: #ff7a00;
  --accent-soft: #fcefd3;
  --accent-ink: #5a3b00;
  --leaf: #5c8a1c;
  --leaf-soft: #eaf3dc;
  --danger: #b42318;
  --danger-soft: #fcebe9;
  --info: #2563a8;
  --info-soft: #e5eff9;
  --ground: #eef2f1;
  --surface: #ffffff;
  --soft: #f5f8f7;
  --line: #d9e2e0;
  --line-2: #e9efee;
  --text: #13262a;
  --muted: #536663;
  --muted-2: #6e807d;
  --r-ctl: 10px;
  --r-panel: 16px;
  --shadow: 0 1px 2px rgba(12, 51, 55, 0.06), 0 4px 16px rgba(12, 51, 55, 0.06);
  --shadow-lg: 0 12px 40px rgba(12, 51, 55, 0.18);
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-feature-settings: 'tnum';
  background: var(--ground);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: plaintext; text-align: start; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(231, 152, 0, 0.22), transparent 60%),
    radial-gradient(800px 600px at 0% 110%, rgba(4, 118, 123, 0.35), transparent 60%),
    linear-gradient(160deg, #071f22 0%, var(--ink) 55%, #0a2a2d 100%);
}
.login-card { width: min(420px, 100%); text-align: center; }
.login-card .logo { width: 230px; max-width: 70%; margin: 0 auto 6px; display: block; }
.login-card .tag {
  color: var(--accent); letter-spacing: 0.32em; font-size: 11px; font-weight: 600; margin-bottom: 26px;
  display: flex; align-items: center; justify-content: center; gap: 12px; direction: ltr;
}
.login-card .tag::before, .login-card .tag::after { content: ''; width: 34px; height: 1px; background: rgba(231, 152, 0, 0.55); }
.login-box {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(231, 152, 0, 0.35);
  border-radius: 22px;
  padding: 30px 28px 26px;
  text-align: right;
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.login-box h1 { color: #fff; margin: 0 0 4px; font-size: 24px; }
.login-box p { color: #a9c4c1; margin: 0 0 22px; font-size: 13.5px; }
.login-box label { color: #dbe9e7; font-size: 13px; font-weight: 600; display: block; margin-bottom: 8px; }
.login-box .pw { position: relative; }
.login-box input {
  width: 100%; height: 50px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28); color: #fff; padding: 0 16px 0 48px; font-size: 15px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(231, 152, 0, 0.18); }
.login-box .eye { position: absolute; left: 10px; top: 9px; width: 32px; height: 32px; border: 0; background: none; color: #a9c4c1; cursor: pointer; border-radius: 8px; }
.login-box .err { color: #ffb4a8; font-size: 13px; min-height: 20px; margin: 8px 0 4px; }
.btn-hero {
  width: 100%; height: 50px; border: 0; border-radius: 14px; cursor: pointer; font-weight: 700; font-size: 16px; color: #1d1200;
  background: linear-gradient(90deg, var(--accent-2), var(--accent) 55%, #ffd79a);
  box-shadow: 0 10px 30px rgba(255, 122, 0, 0.28);
  transition: transform 0.15s, filter 0.15s;
}
.btn-hero:hover { filter: brightness(1.05); }
.btn-hero:active { transform: translateY(1px); }
.btn-hero:disabled { opacity: 0.6; cursor: wait; }
.login-foot { color: #6f8d8a; font-size: 12px; margin-top: 18px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side {
  background: linear-gradient(180deg, var(--ink) 0%, #0a2b2e 100%);
  color: #cfe0de; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px;
}
.side .brand { padding: 6px 10px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); margin-bottom: 12px; }
.side .brand img { width: 150px; display: block; }
.side .brand small { display: block; color: var(--accent); letter-spacing: 0.18em; font-size: 10px; font-weight: 600; margin-top: 6px; direction: ltr; text-align: right; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav .group { font-size: 11px; color: #6f8f8b; font-weight: 600; padding: 14px 12px 6px; letter-spacing: 0.03em; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #cfe0de; font-weight: 500;
  transition: background 0.15s, color 0.15s; position: relative;
}
.nav a svg { width: 19px; height: 19px; flex: none; opacity: 0.85; }
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(4, 118, 123, 0.55), rgba(4, 118, 123, 0.25)); color: #fff; }
.nav a.active::before { content: ''; position: absolute; right: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px 0 0 4px; background: var(--accent); }
.nav .pill { margin-inline-start: auto; background: var(--accent); color: #1d1200; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 99px; line-height: 20px; min-width: 20px; text-align: center; }
.side .foot { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 12px; display: flex; align-items: center; gap: 10px; }
.side .foot .who { flex: 1; font-size: 13px; }
.side .foot .who b { color: #fff; display: block; font-weight: 600; }
.side .foot button { background: rgba(255, 255, 255, 0.07); border: 0; color: #cfe0de; border-radius: 10px; padding: 8px 10px; cursor: pointer; font-size: 12.5px; }
.side .foot button:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 18px 28px; background: rgba(238, 242, 241, 0.85);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line-2);
}
.topbar h2 { margin: 0; font-size: 21px; font-weight: 700; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; border: 0; background: var(--surface); border-radius: 10px; width: 40px; height: 40px; box-shadow: var(--shadow); cursor: pointer; }
.content { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }

/* ---------- agent status chip ---------- */
.status-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px; font-weight: 600; font-size: 13px; background: var(--surface); box-shadow: var(--shadow); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); display: inline-block; }
.dot.on { background: #16a34a; box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15); }
.dot.test { background: var(--accent); box-shadow: 0 0 0 4px rgba(231, 152, 0, 0.18); }
.dot.off { background: var(--danger); }

/* ---------- cards / grid ---------- */
.card { background: var(--surface); border-radius: var(--r-panel); box-shadow: var(--shadow); border: 1px solid var(--line-2); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-h h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.card-h .muted { font-size: 12.5px; }
.card-b { padding: 18px 20px; }
.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.two { grid-template-columns: 1.6fr 1fr; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--mint); color: var(--brand); }
.kpi .ico svg { width: 21px; height: 21px; }
.kpi .ico.o { background: var(--accent-soft); color: #b06f00; }
.kpi .ico.g { background: var(--leaf-soft); color: var(--leaf); }
.kpi .ico.r { background: var(--danger-soft); color: var(--danger); }
.kpi .ico.b { background: var(--info-soft); color: var(--info); }
.kpi .v { font-size: 28px; font-weight: 700; line-height: 1.1; margin-top: 6px; }
.kpi .v small { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi.link { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.kpi.link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* chart */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 210px; padding: 10px 4px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.chart .bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.chart .bar { width: 30%; max-width: 18px; border-radius: 6px 6px 3px 3px; min-height: 3px; transition: height 0.5s cubic-bezier(.2,.8,.2,1); }
.chart .bar.c { background: var(--brand); }
.chart .bar.o { background: var(--accent); }
.chart .bar.b { background: #7fb6b3; }
.chart .lbl { font-size: 11.5px; color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-inline-end: 6px; vertical-align: -1px; }

/* checklist */
.checks { display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--soft); }
.check .ok { color: #16a34a; font-weight: 700; }
.check .no { color: var(--danger); font-weight: 700; }

/* ---------- buttons / forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-ctl);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:hover { background: var(--soft); border-color: #c5d3d0; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.accent { background: linear-gradient(90deg, var(--accent-2), var(--accent)); border: 0; color: #1d1200; box-shadow: 0 6px 18px rgba(255, 122, 0, 0.22); }
.btn.accent:hover { filter: brightness(1.04); }
.btn.danger { color: var(--danger); border-color: #f1c4bf; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--mint); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn.icon { width: 36px; padding: 0; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 13.5px; }
.field .hint { color: var(--muted-2); font-size: 12px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); padding: 10px 13px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input, .select { height: 42px; padding-top: 0; padding-bottom: 0; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(4, 118, 123, 0.12); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search input { padding-inline-start: 38px; }
.search svg { position: absolute; right: 12px; top: 12px; width: 18px; height: 18px; color: var(--muted-2); }
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; gap: 2px; box-shadow: var(--shadow); flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 7px 13px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.tabs button.on { background: var(--ink); color: #fff; }
.tabs button .c { font-size: 11px; opacity: 0.75; margin-inline-start: 4px; }

/* switch */
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #c8d3d1; border-radius: 99px; transition: 0.2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; right: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.switch input:checked + span { background: #16a34a; }
.switch input:checked + span::before { transform: translateX(-20px); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 600; padding: 12px 14px; background: var(--soft); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.t th:first-child { border-top-right-radius: 12px; }
.t th:last-child { border-top-left-radius: 12px; }
.t td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background 0.12s; }
.t tbody tr:hover { background: #fafcfb; }
.t .clip { max-width: 320px; white-space: pre-wrap; word-break: break-word; }
.t .actions { white-space: nowrap; display: flex; gap: 6px; justify-content: flex-end; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--soft); color: var(--muted); }
.badge.green { background: var(--leaf-soft); color: var(--leaf); }
.badge.teal { background: var(--mint); color: var(--brand-dark); }
.badge.orange { background: var(--accent-soft); color: #9a5f00; }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.gray { background: #edf1f0; color: var(--muted); }

/* empty / loading */
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 46px; height: 46px; color: var(--mint-2); margin-bottom: 8px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.skeleton { height: 14px; border-radius: 8px; background: linear-gradient(90deg, #e8eeed, #f4f7f6, #e8eeed); background-size: 200% 100%; animation: sk 1.2s infinite; margin: 10px 0; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- chats ---------- */
.chats { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 150px); min-height: 520px; overflow: hidden; }
.chat-list { border-left: 1px solid var(--line-2); display: flex; flex-direction: column; min-height: 0; }
.chat-list .search { max-width: none; margin: 14px; }
.chat-items { overflow-y: auto; flex: 1; }
.chat-item { display: flex; gap: 12px; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--line-2); transition: background 0.12s; }
.chat-item:hover { background: var(--soft); }
.chat-item.on { background: var(--mint); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--ink-3)); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; font-size: 15px; }
.chat-item .meta { flex: 1; min-width: 0; }
.chat-item .row1 { display: flex; justify-content: space-between; gap: 8px; }
.chat-item .row1 b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .row1 span { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }
.chat-item .last { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; min-height: 0; background: #f3f6f5; }
.thread-h { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.thread-h .meta { flex: 1; }
.thread-b {
  flex: 1; overflow-y: auto; padding: 22px 26px; display: flex; flex-direction: column; gap: 10px;
  background-image: radial-gradient(rgba(4, 118, 123, 0.06) 1px, transparent 1px); background-size: 18px 18px;
}
.msg { max-width: 68%; padding: 9px 13px 6px; border-radius: 14px; box-shadow: 0 1px 1px rgba(0,0,0,0.05); white-space: pre-wrap; word-break: break-word; }
.msg .time { font-size: 10.5px; color: var(--muted-2); margin-top: 3px; text-align: left; }
.msg.user { align-self: flex-start; background: var(--surface); border-top-right-radius: 4px; }
.msg.bot { align-self: flex-end; background: #dff3ef; border-top-left-radius: 4px; }
.msg.staff { align-self: flex-end; background: var(--accent-soft); border-top-left-radius: 4px; }
.msg .who { font-size: 11px; font-weight: 700; color: var(--brand); margin-bottom: 2px; }
.msg.staff .who { color: #9a5f00; }
.thread-empty { flex: 1; display: grid; place-items: center; color: var(--muted); }
.banner { padding: 10px 16px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.banner.paused { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- test chat ---------- */
.tester { display: grid; grid-template-columns: 1fr 320px; gap: 18px; }
.phone { height: calc(100vh - 170px); min-height: 520px; display: flex; flex-direction: column; overflow: hidden; }
.phone .thread-b { background-color: #ece5dd; background-image: none; }
.composer { display: flex; gap: 10px; padding: 12px; background: var(--surface); border-top: 1px solid var(--line-2); }
.composer textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; border-radius: 22px; padding: 10px 16px; }
.composer .btn { border-radius: 50%; width: 44px; height: 44px; padding: 0; }
.typing { align-self: flex-end; background: #dff3ef; border-radius: 14px; padding: 10px 14px; display: flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); opacity: 0.4; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 50% { opacity: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-size: 13px; transition: 0.15s; }
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--mint); }
.tool-note { align-self: center; font-size: 11.5px; color: var(--muted); background: rgba(255,255,255,0.7); border-radius: 99px; padding: 3px 12px; }

/* ---------- knowledge ---------- */
.ksec .card-h .badge { margin-inline-start: auto; }
.ksec textarea { min-height: 180px; font-size: 14px; }
.savebar {
  position: sticky; bottom: 16px; margin-top: 18px; display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--ink); color: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 4;
}
.savebar .spacer { flex: 1; }

/* ---------- upload ---------- */
.drop {
  border: 2px dashed #b8cfcb; border-radius: 18px; padding: 42px 20px; text-align: center; cursor: pointer; background: var(--soft);
  transition: 0.2s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--mint); }
.drop svg { width: 46px; height: 46px; color: var(--brand); }
.drop b { display: block; font-size: 16px; margin: 8px 0 4px; }

/* ---------- modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 30, 33, 0.55); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade 0.15s; backdrop-filter: blur(2px); }
.modal { width: min(760px, 100%); max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); animation: pop 0.18s cubic-bezier(.2,.8,.2,1); }
.modal-h { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-h h3 { margin: 0; flex: 1; font-size: 17px; }
.modal-b { padding: 20px 22px 6px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-start; padding: 14px 22px 20px; }
.lang-tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 6px; margin-inline-start: 6px; }
.lang-tag.bh { background: var(--mint); color: var(--brand-dark); }
.lang-tag.msa { background: var(--accent-soft); color: #9a5f00; }
.lang-tag.en { background: var(--info-soft); color: var(--info); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.toasts { position: fixed; bottom: 22px; left: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop 0.2s; display: flex; gap: 10px; align-items: center; max-width: 380px; }
.toast.err { background: var(--danger); }
.toast.ok::before { content: '✓'; color: #7ee2a8; font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .two, .tester { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; right: 0; top: 0; bottom: 0; width: 270px; z-index: 60; transform: translateX(100%); transition: transform 0.25s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .menu-btn { display: grid; place-items: center; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px; }
  .chats { grid-template-columns: 1fr; height: auto; }
  .chats.has-thread .chat-list { display: none; }
  .chats:not(.has-thread) .thread { display: none; }
  .thread { height: calc(100vh - 140px); }
  .msg { max-width: 86%; }
  .status-chip .txt { display: none; }
}
.menu-back { display: none; }
@media (max-width: 860px) { .menu-back { display: inline-flex; } }
.chat-list .search { flex: none; }
.switch { display: inline-block; vertical-align: middle; }
.side .foot button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; }
.side .foot button svg { width: 18px; height: 18px; }
.kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1300px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi .v { font-size: 22px; } }
.brand img { min-height: 40px; }
.content { padding-bottom: 96px; }
