/* ============ Impress3D dashboard design system ============ */
:root {
  --brand: #25d366;
  --brand-600: #1fbe5b;
  --brand-700: #128c7e;
  --brand-soft: #e7f9ef;
  --accent: #6366f1;
  --accent-soft: #eef0ff;
  --amber: #f59e0b;
  --amber-soft: #fef3e2;
  --sky: #0ea5e9;
  --sky-soft: #e6f6fe;
  --rose: #f43f5e;

  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #fbfcfe;
  --border: #eef1f6;
  --border-2: #e6eaf1;
  --text: #0f172a;
  --muted: #7b8698;
  --muted-2: #9aa4b2;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow: 0 6px 24px rgba(16, 24, 40, 0.06), 0 2px 6px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 256px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #0f1626;
  --border: #1f2937;
  --border-2: #263244;
  --text: #e8edf6;
  --muted: #93a0b4;
  --muted-2: #6b7688;
  --brand-soft: #10261c;
  --accent-soft: #171a33;
  --amber-soft: #2a2113;
  --sky-soft: #0e2130;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
svg { display: block; }
.icon { width: 20px; height: 20px; stroke-width: 2; }
.icon-sm { width: 16px; height: 16px; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(37, 211, 102, 0.16), transparent 60%),
    radial-gradient(800px 500px at 100% 110%, rgba(99, 102, 241, 0.14), transparent 55%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 34px 30px;
  text-align: center;
}
.login-logo {
  width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 16px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-700));
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.35);
}
.login-card h1 { font-size: 20px; margin: 6px 0 2px; }
.login-card p { color: var(--muted); margin: 0 0 22px; font-size: 13px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 20px; }
.brand-badge {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-700));
  box-shadow: 0 8px 18px rgba(37, 211, 102, 0.32);
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.2px; }
.brand-sub { font-size: 11px; color: var(--muted); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); padding: 12px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px; color: var(--muted);
  font-weight: 600; font-size: 13.5px; border: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-700); border-color: color-mix(in srgb, var(--brand) 22%, transparent); }
:root[data-theme="dark"] .nav-item.active { color: var(--brand); }
.nav-item .icon { flex: 0 0 auto; }
.nav-spacer { flex: 1; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 30px; position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar h2 { margin: 0; font-size: 19px; letter-spacing: -0.3px; }
.topbar .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.content { padding: 26px 30px 48px; }

/* ---------- Reusable ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 13.5px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  transition: transform 0.05s, background 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-600)); color: #fff; border-color: transparent; box-shadow: 0 8px 18px rgba(37, 211, 102, 0.3); }
.btn-primary:hover { filter: brightness(1.03); background: linear-gradient(135deg, var(--brand), var(--brand-600)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--rose); border-color: color-mix(in srgb, var(--rose) 30%, transparent); background: color-mix(in srgb, var(--rose) 8%, var(--surface)); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border-2); color: var(--muted);
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; font-size: 14px;
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  outline: none; transition: border 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.14); background: var(--surface); }
.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-head h3 { margin: 0; font-size: 15px; letter-spacing: -0.2px; }
.card-head .sub { color: var(--muted); font-size: 12px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-2);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--brand-700); background: var(--brand-soft); border-color: transparent; }
.badge.warn { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.badge.off { color: var(--rose); background: color-mix(in srgb, var(--rose) 10%, var(--surface)); border-color: transparent; }
.badge.live .dot { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5);} 70%{ box-shadow:0 0 0 6px rgba(37,211,102,0);} 100%{box-shadow:0 0 0 0 rgba(37,211,102,0);} }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
.kpi .kpi-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; }
.kpi .kpi-val { font-size: 26px; font-weight: 750; letter-spacing: -0.6px; }
.kpi .kpi-lbl { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .kpi-trend { font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.trend-up { color: var(--brand-700); }
.trend-flat { color: var(--muted-2); }
.tone-green { background: var(--brand-soft); color: var(--brand-700); }
.tone-indigo { background: var(--accent-soft); color: var(--accent); }
.tone-amber { background: var(--amber-soft); color: var(--amber); }
.tone-sky { background: var(--sky-soft); color: var(--sky); }

/* ---------- Grid layout ---------- */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-top: 18px; }
.grid-2b { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; margin-top: 18px; }

/* ---------- Chart ---------- */
.chart-legend { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 500; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut-center { text-align: center; }
.donut-center .big { font-size: 22px; font-weight: 750; }
.donut-center .small { font-size: 11px; color: var(--muted); }

/* ---------- Chat log list ---------- */
.log-row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-radius: 12px; }
.log-row:hover { background: var(--surface-2); }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; }
.log-row .who { font-weight: 600; font-size: 13.5px; }
.log-row .msg { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.log-row .time { margin-left: auto; color: var(--muted-2); font-size: 11.5px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }

/* ---------- Conversations page ---------- */
.chat-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; height: calc(100vh - 190px); min-height: 460px; }
.chat-list { overflow-y: auto; padding: 8px; }
.chat-list .item { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; }
.chat-list .item:hover { background: var(--surface-2); }
.chat-list .item.active { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 22%, transparent); }
.chat-list .item .who { font-weight: 600; font-size: 13.5px; }
.chat-list .item .prev { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.chat-panel { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.chat-panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.chat-thread { flex: 1; overflow-y: auto; padding: 22px; background:
  radial-gradient(circle at 12px 12px, color-mix(in srgb, var(--muted) 8%, transparent) 1px, transparent 0) 0 0 / 24px 24px; }
.bubble { max-width: 74%; padding: 10px 13px; border-radius: 14px; margin-bottom: 10px; font-size: 13.5px; line-height: 1.45; box-shadow: var(--shadow-sm); white-space: pre-wrap; word-break: break-word; }
.bubble.user { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble.assistant { background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand) 12%, var(--surface))); margin-left: auto; border-bottom-right-radius: 5px; }
.bubble .b-time { display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 4px; }
.bubble-media { display: block; max-width: 240px; max-height: 300px; width: auto; border-radius: 10px; margin-bottom: 4px; cursor: pointer; }
.bubble-audio { display: block; width: 240px; max-width: 100%; height: 40px; margin-bottom: 4px; }
.bubble-doc { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-2); font-weight: 600; font-size: 12.5px; margin-bottom: 4px; }
.media-missing { font-size: 12.5px; color: var(--muted-2); font-style: italic; }
.who-tag { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; opacity: 0.55; margin-bottom: 3px; text-transform: uppercase; }
.bubble.agent { background: linear-gradient(135deg, var(--amber-soft), color-mix(in srgb, var(--amber) 12%, var(--surface))); }

/* ---------- Per-chat AI pause toggle ---------- */
.pause-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border-2); white-space: nowrap; }
.pause-toggle input { accent-color: var(--amber); width: 16px; height: 16px; cursor: pointer; }
.pause-toggle:has(input:checked) { color: var(--amber); background: var(--amber-soft); border-color: transparent; }

/* ---------- Manual reply composer ---------- */
.chat-composer { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.composer-input { flex: 1; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font-size: 14px; outline: none; transition: border 0.15s, box-shadow 0.15s; }
.composer-input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.14); background: var(--surface); }
.chat-composer .btn { padding: 0 18px; }

/* ---------- Connection / QR ---------- */
.qr-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
.qr-stage { display: grid; place-items: center; padding: 26px; text-align: center; }
.qr-frame { width: 260px; height: 260px; border-radius: 20px; background: #fff; padding: 14px; box-shadow: var(--shadow); display: grid; place-items: center; position: relative; border: 1px solid var(--border); }
.qr-frame img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.qr-frame.empty { color: var(--muted-2); }
.qr-skeleton { width: 100%; height: 100%; border-radius: 12px; background: linear-gradient(100deg, var(--surface-2) 30%, var(--border) 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 13px; }
.step .n { counter-increment: s; width: 28px; height: 28px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-700); font-weight: 700; display: grid; place-items: center; flex: 0 0 auto; font-size: 13px; }
.step .n::before { content: counter(s); }
.step .t { font-size: 13.5px; color: var(--text); }
.step .t small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- misc ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--muted); }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty-state .icon { width: 40px; height: 40px; margin: 0 auto 12px; opacity: 0.5; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transition: 0.25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.spin { animation: rot 0.9s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .grid-2, .grid-2b { grid-template-columns: 1fr; } .qr-grid { grid-template-columns: 1fr; } .settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); z-index: 40; transition: transform 0.25s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: grid !important; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .content { padding: 18px; }
  .topbar { padding: 16px 18px; }
}
.menu-toggle { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 35; opacity: 0; pointer-events: none; transition: 0.2s; }
.scrim.show { opacity: 1; pointer-events: auto; }

/* ---------- Phase 2A: filters, labels, multi-number ---------- */
.conv-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-2); transition: all 0.15s;
}
.fchip:hover { background: var(--surface-2); color: var(--text); }
.fchip.on { background: var(--brand-soft); color: var(--brand-700); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
:root[data-theme="dark"] .fchip.on { color: var(--brand); }
.fchip .icon { width: 14px; height: 14px; }
.lbl-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* label chips on conversation rows */
.lbl {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  color: var(--lc); background: color-mix(in srgb, var(--lc) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--lc) 30%, transparent);
}
.item-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }

.flag { font-size: 13px; }

/* label editor bar in the open chat */
.chat-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 11px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.labels-lead { color: var(--muted-2); display: inline-flex; }
.lbl-toggle {
  padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600; cursor: pointer;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border-2); transition: all 0.12s;
}
.lbl-toggle:hover { border-color: var(--lc); color: var(--lc); }
.lbl-toggle.on { color: #fff; background: var(--lc); border-color: var(--lc); }

/* multi-number connection grid */
.num-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 1080px) { .num-grid { grid-template-columns: 1fr; } }

/* prompt editor */
.prompt-tabs { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.ptab { padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--border-2); cursor: pointer; transition: all 0.15s; }
.ptab:hover { background: var(--surface-2); color: var(--text); }
.ptab.on { background: var(--brand-soft); color: var(--brand-700); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
:root[data-theme="dark"] .ptab.on { color: var(--brand); }
.prompt-status { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.prompt-area { font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace; font-size: 12.5px; line-height: 1.55; resize: vertical; min-height: 300px; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
@media (max-width: 860px) { #promptHint { display: none; } }

/* create-your-own label input */
.lbl-new-input { border: 1px dashed var(--border-2); background: transparent; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--text); outline: none; max-width: 150px; transition: border 0.15s; }
.lbl-new-input::placeholder { color: var(--muted-2); font-weight: 500; }
.lbl-new-input:focus { border-color: var(--brand); border-style: solid; box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12); }

/* bulk-select + 2FA */
.list-toolbar { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; }
.list-tbtn { padding: 6px 10px; font-size: 12.5px; }
.sel-chk { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--brand); }
.item.sel { background: var(--brand-soft); }
.twofa-secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; font-weight: 700; letter-spacing: 2px; background: var(--surface-2); border: 1px dashed var(--border-2); border-radius: 10px; padding: 12px; text-align: center; user-select: all; word-break: break-all; }

/* composer attach button */
.composer-attach { flex: 0 0 auto; cursor: pointer; }
.chat-panel.drop-hi { outline: 2px dashed var(--brand); outline-offset: -6px; background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }

/* conversation search */
.chat-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.chat-col .chat-list { flex: 1; min-height: 0; }
.chat-search { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-2); color: var(--muted); box-shadow: var(--shadow-sm); }
.chat-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12); }
.chat-search input { border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13.5px; width: 100%; font-family: inherit; }
.chat-search input::placeholder { color: var(--muted-2); }

/* AI failure notice (Settings → Assistente) */
.ai-error { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.5;
  background: color-mix(in srgb, #ef4444 10%, var(--surface)); border: 1px solid color-mix(in srgb, #ef4444 35%, var(--border-2)); color: var(--text); }
.ai-error .icon { vertical-align: -3px; color: #ef4444; }
