:root {
  --ink: #1e293b;
  --muted: #64748b;
  --navy: #3b82f6;
  --navy-2: #2563eb;
  --paper: #f6f8fc;
  --card: #ffffff;
  --line: #e8edf4;
  --accent: #e31b23;
  --accent-2: #2563eb;
  --ok: #059669;
  --danger: #dc2626;
  --wait: #d97706;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(17, 24, 39, 0.05);
  --shadow-2: 0 12px 32px rgba(17, 24, 39, 0.08);
  --font: "Be Vietnam Pro", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.guest-body { background: radial-gradient(1200px 500px at 10% -10%, #fbe7d2, transparent), var(--paper); }
.auth-wrap { max-width: 1080px; margin: 0 auto; padding: 32px 20px 80px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 48px;
}
.brand { display: flex; gap: 10px; align-items: center; color: var(--navy); font-weight: 700; font-size: 22px; text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--navy);
  color: #f6ead7; display: grid; place-items: center; font-size: 18px;
}
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 46px; line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.03em; }
.hero p.lead { font-size: 18px; color: var(--muted); margin: 0 0 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 600; cursor: pointer;
  font-family: inherit; font-size: 14px; text-decoration: none;
}
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 6px 16px rgba(59, 130, 246, .22); }
.btn-primary:hover { background: var(--navy-2); text-decoration: none; color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.05); text-decoration: none; color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { background: #f8fafc; text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.hero-card, .card, .auth-card, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.hero-card { padding: 24px; }
.feature-grid, .plan-grid, .stat-grid { display: grid; gap: 16px; }
.feature-grid { grid-template-columns: repeat(3, 1fr); margin-top: 56px; }
.plan-grid { grid-template-columns: repeat(3, 1fr); }
.stat-grid { grid-template-columns: repeat(4, 1fr); }
.feature, .plan {
  padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.plan.featured { border-color: var(--navy); outline: 2px solid rgba(18,32,51,.12); }
.plan-catalog { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan-card {
  padding: 22px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.plan-card.featured {
  border-color: var(--navy);
  box-shadow: 0 14px 36px rgba(18,32,51,.1);
}
.plan-card.inactive { opacity: .72; }
.plan-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan-card-flags { display: flex; gap: 6px; flex-shrink: 0; }
.plan-name-input {
  font-size: 18px; font-weight: 700; letter-spacing: -.02em;
  padding: 8px 10px; min-width: 0;
}
.plan-price-edit { display: flex; align-items: baseline; gap: 8px; }
.plan-price-edit input { font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.plan-price-edit small { color: var(--muted); font-weight: 600; white-space: nowrap; }
.plan-params { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-params label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.plan-params input { font-weight: 600; color: var(--ink); }
.plan-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: var(--navy); color: #fff; border-radius: 999px; padding: 4px 8px;
}
.plan-tag-off { background: #8a8174; }
.plan-price { font-size: 30px; font-weight: 700; margin: 0; letter-spacing: -.03em; line-height: 1.1; }
.plan-price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan-features { list-style: none; margin: 0; padding: 0; }
.plan-features li {
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted);
}
.plan-used { margin: auto 0 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.plan-card-actions { margin-top: auto; }
.plan-edit { display: flex; flex-direction: column; gap: 12px; }
.plan-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.plan-pills form { margin: 0; }
.plan-pill {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; line-height: 1.2;
}
button.plan-pill:hover { border-color: var(--navy); color: var(--navy); }
.plan-pill.current { background: var(--navy); color: #fff; border-color: var(--navy); cursor: default; }
.industry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.industry-card {
  display: block; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; cursor: pointer; min-height: 52px;
}
.industry-card strong { font-size: 13px; font-weight: 600; }
.industry-card input { position: absolute; opacity: 0; pointer-events: none; }
.industry-card:hover { border-color: #c5cbd6; }
.industry-card.selected, .industry-card:has(input:checked) {
  border-color: var(--navy); box-shadow: 0 0 0 2px rgba(18,32,51,.12); background: #f7f9fc;
}
.kicker { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; text-transform: none; }
.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #4f8fd4 0%, #3b73b8 100%);
  color: #fff;
  padding: 14px 10px 12px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; min-height: 0;
  box-shadow: 6px 0 24px rgba(37, 99, 235, .12);
}
.sidebar .brand {
  margin: 0 8px 12px; color: #fff; gap: 10px; font-size: 18px; font-weight: 800;
}
.sidebar .brand img {
  height: 30px; width: 30px; object-fit: contain; display: block;
  background: #fff; border-radius: 9px; padding: 3px;
}
.sidebar .brand span { letter-spacing: -.02em; }
.side-ws {
  margin: 0 4px 10px; padding: 8px;
  background: rgba(255,255,255,.16); border-radius: 14px;
}
.side-ws-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.side-ws-main img, .side-ws-ava {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: #fff; object-fit: contain;
}
.side-ws-ava {
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #1d4ed8;
}
.side-ws-meta { min-width: 0; }
.side-ws-meta strong {
  display: block; font-size: 13px; line-height: 1.3; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-ws-tag {
  display: inline-block; margin-top: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: #fff4c4; color: #92400e; border-radius: 999px; padding: 2px 7px;
}
.side-ws-back { margin: 8px 0 0; }
.side-ws-back .btn { width: 100%; padding: 6px 10px; font-size: 12px; }
.side-nav { flex: 1; min-height: 0; overflow: auto; padding-right: 2px; }
.sidebar a {
  color: #fff; text-decoration: none; display: flex; gap: 10px; align-items: center;
  padding: 9px 12px; border-radius: 12px; font-size: 14px; font-weight: 600;
}
.sidebar a:hover { background: rgba(255,255,255,.16); color: #fff; text-decoration: none; }
.sidebar a.active {
  background: #fff; color: #1d4ed8;
  box-shadow: 0 8px 18px rgba(15, 39, 68, .14);
}
.sidebar .nav-ico {
  width: 19px; height: 19px; flex-shrink: 0; opacity: 1; color: currentColor;
}
.sidebar .nav-label {
  margin: 16px 12px 6px; font-size: 11px; color: rgba(255,255,255,.78); letter-spacing: .08em;
  text-transform: uppercase; font-weight: 700;
}
.side-foot { padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.22); margin-top: 12px; }
.acct-menu { position: relative; margin: 0 2px; }
.acct-trig {
  width: 100%; display: flex; gap: 10px; align-items: center;
  padding: 8px; border: 0; border-radius: 14px; cursor: pointer;
  background: rgba(255,255,255,.16); color: #fff; font: inherit; text-align: left;
}
.acct-trig:hover { background: rgba(255,255,255,.24); }
.acct-menu.open .acct-trig {
  background: #fff; color: #1e3a5f;
  box-shadow: 0 8px 18px rgba(15, 39, 68, .12);
}
.acct-trig-meta { min-width: 0; display: grid; gap: 2px; }
.acct-trig-meta strong { font-size: 13px; line-height: 1.25; }
.acct-trig-meta em {
  font-style: normal; font-size: 11px; color: rgba(255,255,255,.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.acct-menu.open .acct-trig-meta em { color: #64748b; }
.acct-pop {
  display: none; position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  background: #fff; color: #1e3a5f; border: 1px solid #d5e4f8;
  border-radius: 16px; box-shadow: 0 16px 36px rgba(37, 99, 235, .2);
  padding: 8px; z-index: 30;
}
.acct-menu.open .acct-pop { display: grid; gap: 4px; }
.sidebar .acct-pop a,
.acct-pop button[type="submit"] {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 10px; background: transparent;
  color: #1e3a5f; font: inherit; font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer; text-align: left;
}
.sidebar .acct-pop a { color: #1d4ed8; }
.sidebar .acct-pop a:hover { background: #e8f1ff; color: #1d4ed8; text-decoration: none; }
.acct-pop button[type="submit"] { color: #dc2626; }
.acct-pop button[type="submit"]:hover { background: #fef2f2; color: #b91c1c; }
.acct-pop .nav-ico { width: 18px; height: 18px; }
.acct-theme {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px;
  padding: 4px; margin: 2px 0; background: #e8f1ff; border-radius: 12px;
}
.acct-theme button {
  border: 0; background: transparent; color: #5b7aa8; cursor: pointer;
  border-radius: 9px; padding: 8px 4px; display: grid; place-items: center;
}
.acct-theme button .nav-ico { width: 18px; height: 18px; }
.acct-theme button.on {
  background: #2563eb; color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, .28);
}
.acct-pop form { margin: 0; border-top: 1px solid #e8edf4; padding-top: 4px; margin-top: 2px; }
.sidebar select {
  background: rgba(255,255,255,.94); color: #123258; border-color: transparent; border-radius: 10px; margin: 0 4px 10px;
}
.sidebar .btn-ghost { color: #1d4ed8; border-color: transparent; background: #fff; font-weight: 600; }
.main { padding: 28px 32px; min-width: 0; overflow-x: auto; background: var(--paper); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-head .muted { margin: 6px 0 0; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 220px; max-width: 360px; }
.filter-chip {
  display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none;
  background: #fff;
}
.filter-chip:hover { color: var(--ink); text-decoration: none; }
.filter-chip.active { background: #e8f0ff; border-color: #c7dbff; color: var(--navy-2); }
.table-wrap { overflow-x: auto; }
.table-users { min-width: 860px; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-head h3 { margin: 0; }
.modal-head .muted { margin: 6px 0 0; }
.modal-card.team-modal { width: min(580px, 100%); }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .split-2 { grid-template-columns: 1fr; } }
.table-users td, .table-users th { vertical-align: middle; white-space: nowrap; }
.table-users td.user-cell { white-space: normal; }
.user-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: #e8eef6; color: #1d4f91;
}
.avatar-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 18px; }
img.avatar, img.inbox-ava, img.ib-avatar {
  object-fit: cover; padding: 0; border: 0; background: #e8eef6;
}
.user-meta { min-width: 0; }
.user-meta strong { display: block; font-size: 14px; }
.user-meta span { display: block; font-size: 12px; color: var(--muted); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.row-actions form { margin: 0; }
.user-hero { display: flex; gap: 16px; align-items: center; padding: 20px 22px; }
.user-hero h2 { margin: 0 0 4px; font-size: 20px; }
.user-hero .hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.user-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.manage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.manage-grid .card { padding: 20px; }
.card-block { display: grid; gap: 12px; }
.card-block + .card-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.card-block h3 { margin: 0; }
.member-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.member-row:last-child { border-bottom: 0; }
.member-row .row-actions { flex-wrap: wrap; }
.modal-back {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: rgba(16, 32, 51, .46);
  align-items: flex-start; justify-content: center;
  padding: 48px 16px 24px; overflow: auto;
}
.modal-back.on { display: flex; }
.modal-card {
  background: #fff; border-radius: 16px; width: min(520px, 100%);
  padding: 22px; box-shadow: 0 18px 50px rgba(16, 32, 51, .28);
}
.status-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cred-box {
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center;
  padding: 14px 16px; background: #e8f6ee; border-radius: 12px; margin-bottom: 16px;
}
.cred-box code { font-size: 13px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state h3 { margin: 0 0 8px; color: var(--ink); }
.settings-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: -8px 0 22px; border-bottom: 1px solid var(--line); }
.settings-tabs a {
  padding: 10px 16px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.settings-tabs a:hover { color: var(--ink); text-decoration: none; }
.settings-tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
.muted { color: var(--muted); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; gap: 6px; }
label { font-size: 13px; font-weight: 600; color: #374151; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  font-family: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: #c7d2fe; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
input[type="checkbox"], input[type="radio"] {
  width: auto; height: auto; padding: 0; margin: 0; border: 0; border-radius: 0;
  background: none; flex: none; accent-color: var(--navy);
}
textarea { min-height: 120px; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.alert-error { background: #fde8e6; color: #7a1c14; }
.alert-ok { background: #e8f6ee; color: #215c38; }
.alert-info { background: #e8f1ff; color: #1d4ed8; }
.health-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.health-card { padding: 16px 18px; }
.health-card h3 { margin: 6px 0 8px; font-size: 16px; }
.health-card.ok { border-color: #b7e0c4; background: #f3faf5; }
.health-card.bad { border-color: #f0c4c0; background: #fff6f4; }
.sys-log {
  margin: 0; padding: 12px 14px; border-radius: 12px; background: #0f172a; color: #e2e8f0;
  font-size: 12px; line-height: 1.5; overflow: auto; max-height: 280px; white-space: pre-wrap;
}
.sys-log.tall { max-height: 360px; }
.nowrap { white-space: nowrap; }
@media (max-width: 980px) { .health-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .health-grid { grid-template-columns: 1fr; } }
[data-theme="dark"] .alert-info { background: #1c2a44; color: #93c5fd; }
[data-theme="dark"] .health-card.ok { background: #163028; border-color: #14532d; }
[data-theme="dark"] .health-card.bad { background: #3a1c22; border-color: #7f1d1d; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-ai { background: #e7eef8; color: #1d4f91; }
.badge-waiting { background: #fff4e5; color: #9a3412; }
.badge-assigned { background: #efe7fb; color: #5b21b6; }
.badge-closed { background: #ececec; color: #444; }
.badge-ok { background: #e8f6ee; color: #215c38; }
.progress { height: 8px; background: #eef1f5; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent-2); }
.auth-card { max-width: 440px; margin: 40px auto; padding: 28px; }
.auth-card h1 { margin-top: 0; }
.codebox { background: #0f1b2b; color: #f3e6d0; padding: 14px; border-radius: 10px; font-family: ui-monospace, monospace; font-size: 12px; overflow: auto; }
.chat-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; min-height: 70vh; }
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 62vh; overflow: auto; padding-right: 6px; }
.bubble { max-width: 78%; padding: 10px 12px; border-radius: 12px; line-height: 1.45; }
.bubble.visitor { background: #eef1f5; margin-right: auto; }
.bubble.ai { background: #e7eef8; margin-left: auto; }
.bubble.agent { background: #e7f4ea; margin-left: auto; }
.bubble.system { background: #fff; border: 1px dashed var(--line); margin: 0 auto; font-size: 13px; color: var(--muted); }
.list-item { display: block; padding: 12px; border-bottom: 1px solid var(--line); color: inherit; }
.list-item:hover { background: #f5f7fb; text-decoration: none; }
.list-item.active { background: #eef2f7; }
.two-col { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; }
[hidden] { display: none !important; }
.checks { display: inline-flex; gap: 8px; align-items: center; width: max-content; max-width: 100%; font-weight: 500; }
.checks label { font-weight: 500; display: inline-flex; gap: 8px; align-items: center; width: max-content; }
.embed-frame { height: 540px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
@media (max-width: 980px) {
  .hero, .feature-grid, .plan-grid, .stat-grid, .chat-layout, .app-shell, .two-col, .manage-grid, .plan-catalog { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: relative; }
  .page-head { flex-direction: column; }
}

/* —— Public site (logo red / tech dark) —— */
.site-dark {
  --red: #e31b23;
  --red-2: #ff3b3b;
  --bg: #070708;
  --bg-2: #101114;
  --line-d: rgba(255,255,255,.08);
  --text: #f3f3f5;
  --muted-d: #9b9ba6;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.site-dark a { color: inherit; }
.site-nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(7,7,8,.78);
  border-bottom: 1px solid var(--line-d);
}
.site-nav-inner, .site-footer-inner, .hero-pro-inner, .section, .cta-band, .strip-inner, .site-flash {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}
.site-nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.site-logo img, .site-logo-sm { height: 36px; width: auto; display: block; }
.site-logo-sm { height: 28px; margin-bottom: 10px; }
.site-links { display: flex; align-items: center; gap: 18px; font-size: 14px; font-weight: 500; }
.site-links a { color: var(--muted-d); text-decoration: none; }
.site-links a:hover { color: #fff; text-decoration: none; }
.btn-red {
  background: var(--red); color: #fff !important; border: 0;
  box-shadow: 0 8px 24px rgba(227,27,35,.28);
}
.btn-red:hover { background: #ff2a32; text-decoration: none; color: #fff !important; }
.btn-outline {
  background: transparent; color: #fff !important;
  border: 1px solid var(--line-d);
}
.btn-outline:hover { border-color: #fff; text-decoration: none; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--red-2); margin: 0 0 16px;
}
.chip-dot {
  width: 8px; height: 8px; border-radius: 99px; background: var(--red);
  box-shadow: 0 0 12px var(--red);
}
.hero-pro { position: relative; overflow: hidden; padding: 72px 0 80px; }
.hero-pro-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(800px 400px at 80% 10%, rgba(227,27,35,.22), transparent 55%),
    radial-gradient(600px 300px at 10% 80%, rgba(227,27,35,.08), transparent 50%),
    linear-gradient(180deg, transparent, #070708);
}
.hero-pro-bg::before {
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}
.hero-pro-inner { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero-copy h1 {
  font-size: clamp(34px, 4.6vw, 56px); line-height: 1.12;
  letter-spacing: -.03em; margin: 0 0 18px; font-weight: 800;
}
.hero-copy h1 em { font-style: normal; color: var(--red-2); }
.hero-copy .lead { font-size: 18px; color: var(--muted-d); margin: 0 0 28px; max-width: 540px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 0; margin: 0; list-style: none; color: var(--muted-d); font-size: 13px; }
.hero-points li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 99px; background: var(--red); margin-right: 8px; vertical-align: middle; }
.stage-window {
  background: #0c0d11; border: 1px solid var(--line-d); border-radius: 18px;
  overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 1px rgba(227,27,35,.12);
}
.stage-bar {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  background: #15161c; border-bottom: 1px solid var(--line-d); color: #7a7a86; font-size: 12px;
}
.stage-bar span { width: 8px; height: 8px; border-radius: 99px; background: #3a3a44; }
.stage-bar span:first-child { background: #e31b23; }
.stage-bar strong { margin-left: 8px; font-weight: 500; color: #c5c5ce; }
.stage-chat { padding: 18px; display: flex; flex-direction: column; gap: 10px; min-height: 280px; }
.stage-msg { max-width: 82%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.stage-msg.in { background: #1b1c24; align-self: flex-start; }
.stage-msg.out { background: #2a0f12; border: 1px solid rgba(227,27,35,.35); align-self: flex-end; }
.stage-sys { align-self: center; font-size: 12px; color: #8a8a96; border: 1px dashed var(--line-d); padding: 6px 10px; border-radius: 99px; }
.stage-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.stage-pills span {
  font-size: 12px; color: #cfcfd6; border: 1px solid var(--line-d);
  padding: 6px 10px; border-radius: 99px; background: #101114;
}
.strip { border-block: 1px solid var(--line-d); background: #0b0b0e; }
.strip-inner { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0; flex-wrap: wrap; color: #8d8d98; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.section { padding: 72px 0; }
.section-alt { background: #0b0b0e; border-block: 1px solid var(--line-d); width: 100%; }
.section-alt .section-head, .section-alt .steps { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head h1, .section-head h2 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.02em; margin: 0 0 10px; }
.module-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.mod-card {
  padding: 24px; border-radius: 16px; background: var(--bg-2);
  border: 1px solid var(--line-d);
}
.mod-card h3 { margin: 8px 0 8px; font-size: 20px; }
.mod-card p { margin: 0; color: var(--muted-d); }
.mod-icon { font-family: ui-monospace, monospace; color: var(--red); font-size: 13px; letter-spacing: .12em; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 0; margin: 0; list-style: none; counter-reset: st; }
.steps li { position: relative; padding: 8px 8px 8px 0; }
.steps li::before {
  counter-increment: st; content: counter(st, decimal-leading-zero);
  display: block; color: var(--red); font-weight: 700; font-size: 13px; margin-bottom: 10px; letter-spacing: .12em;
}
.steps strong { display: block; font-size: 18px; margin-bottom: 8px; }
.steps p { margin: 0; color: var(--muted-d); }
.plan-grid-dark .plan {
  background: var(--bg-2); border-color: var(--line-d); color: var(--text);
}
.plan-grid-dark .plan.featured {
  border-color: var(--red); outline: 1px solid rgba(227,27,35,.35);
  box-shadow: 0 16px 50px rgba(227,27,35,.12);
}
.plan-grid-dark .plan ul { padding-left: 18px; color: var(--muted-d); }
.plan-grid-dark .kicker { color: var(--red-2); }
.plan-grid-dark h2 small, .plan-grid-dark h3 small { color: var(--muted-d); font-weight: 500; font-size: 14px; }
.cta-band {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 36px 32px; margin: 0 auto 72px;
  border-radius: 20px; border: 1px solid rgba(227,27,35,.35);
  background: linear-gradient(135deg, #1a0a0c, #101114 55%);
}
.cta-band h2 { margin: 0 0 8px; font-size: 28px; }
.cta-band p { margin: 0; color: var(--muted-d); }
.site-footer { border-top: 1px solid var(--line-d); padding: 36px 0 48px; color: var(--muted-d); font-size: 14px; }
.site-footer p { margin: 6px 0; }
.site-footer-meta { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 12px 0 4px; }
.site-footer-meta a { color: var(--muted-d); text-decoration: none; }
.site-footer-meta a:hover { color: #fff; text-decoration: none; }
.site-banner {
  background: #e31b23; color: #fff; text-align: center;
  padding: 8px 16px; font-size: 13px; font-weight: 600; letter-spacing: .01em;
}
.legal-page { max-width: 760px; }
.legal-page h1 { margin: 0 0 20px; }
.legal-body { line-height: 1.75; color: var(--muted-d); }
.site-flash { padding-top: 16px; }
.site-dark .auth-card {
  background: #121317; border: 1px solid var(--line-d); color: var(--text);
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.site-dark .auth-card a { color: #ff6b70; }
.site-dark input, .site-dark select, .site-dark textarea {
  background: #1a1b22; border-color: #2c2d36; color: #fff;
}
.site-dark .btn-ghost { border-color: #3a3b46; color: #fff; }
.site-dark .muted { color: var(--muted-d); }
.main:has(.inbox-shell) {
  display: flex; flex-direction: column; height: 100vh; overflow: hidden; padding-bottom: 16px;
}
.main:has(.inbox-shell) .page-head,
.main:has(.inbox-shell) .channel-status { flex-shrink: 0; }
.channel-status {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
}
.channel-status.ok { border-color: #b7e0c5; background: #f3fbf6; }
.channel-status.warn { border-color: #f0d9a8; background: #fff8eb; }
.channel-status strong { display: block; font-size: 14px; }
.channel-status .muted { font-size: 13px; }
.inbox-shell {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 280px minmax(0, 1fr) 250px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; box-shadow: var(--shadow);
}
.inbox-shell:not(:has(.inbox-side)) { grid-template-columns: 280px minmax(0, 1fr); }
.inbox-list { overflow: auto; border-right: 1px solid var(--line); background: #fff; }
.inbox-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none;
}
.inbox-item:hover { background: #f5f7fb; text-decoration: none; }
.inbox-item.active { background: #eef2f7; }
.inbox-item-body { min-width: 0; flex: 1; }
.inbox-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.inbox-item-top strong { font-size: 14px; }
.inbox-item .muted { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-ava {
  width: 36px; height: 36px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: #e8eef6; color: #1d4f91;
}
.inbox-ava.num { background: #3b82f6; color: #fff; }
.inbox-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; }
.inbox-chat-hd {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fff;
}
.inbox-empty { margin: auto; text-align: center; padding: 40px 20px; }
.inbox-thread {
  flex: 1; min-height: 0; overflow: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px; background: #f4f6f9;
  overflow-anchor: none;
}
.ib-row { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; }
.ib-row.visitor { align-self: flex-start; }
.ib-row.ai, .ib-row.agent { align-self: flex-end; }
.ib-row.system { align-self: center; max-width: 92%; }
.ib-stack { min-width: 0; display: flex; flex-direction: column; }
.ib-row.agent .ib-meta, .ib-row.ai .ib-meta { text-align: right; }
.ib {
  width: fit-content; max-width: 100%; padding: 9px 12px; border-radius: 14px;
  font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
}
.ib-meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.ib-row.visitor .ib { background: #eef1f5; }
.ib-row.ai .ib { background: #fff; border: 1px solid var(--line); }
.ib-row.agent .ib { background: #e7f4ea; }
.ib-row.system .ib { background: transparent; border: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.ib-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #fff; background: #1b3148;
}
.ib-avatar.guest { background: #2563eb; }
.ib-avatar.bot { background: #1d4f91; }
.ib-avatar.hue-0 { background: #1b3148; }
.ib-avatar.hue-1 { background: #2f7d4a; }
.ib-avatar.hue-2 { background: #1d4f91; }
.ib-avatar.hue-3 { background: #6d28d9; }
.ib-avatar.hue-4 { background: #b45309; }
.ib-typing[hidden] { display: none !important; }
.ib-typing .ib { font-style: italic; color: var(--muted); }
.inbox-item.typing .muted { color: #2563eb; font-style: italic; font-weight: 600; }
.inbox-compose {
  display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line);
  background: #fff; align-items: flex-end;
}
.inbox-compose textarea {
  min-height: 44px; height: 44px; max-height: 140px; resize: none; margin: 0;
}
.inbox-side { padding: 16px; border-left: 1px solid var(--line); overflow: auto; background: #fafbfc; }
.inbox-side h3 { margin: 0 0 10px; font-size: 15px; }
.inbox-side textarea { min-height: 72px; }
@media (max-width: 980px) {
  .hero-pro-inner, .module-grid, .steps, .cta-band { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; }
  .site-links a:not(.btn) { display: none; }
  .main:has(.inbox-shell) { height: auto; overflow: visible; }
  .inbox-shell, .inbox-shell:not(:has(.inbox-side)) { grid-template-columns: 1fr; height: auto; min-height: 70vh; }
  .inbox-list { max-height: 200px; border-right: 0; border-bottom: 1px solid var(--line); }
  .inbox-thread { min-height: 320px; }
  .inbox-side { border-left: 0; border-top: 1px solid var(--line); }
  .kb-layout { grid-template-columns: 1fr; }
}
.kb-layout { display: grid; grid-template-columns: 1.05fr .95fr; gap: 16px; align-items: start; }
.kb-form-card, .kb-list-card { padding: 18px; }
.kb-form-card h3, .kb-list-card h3 { margin: 0 0 4px; }
.kb-gpt {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px;
  border: 1px solid var(--line); background: #fff;
}
.kb-gpt.on { border-color: #b7e0c4; background: #f3faf5; }
.kb-gpt.off { border-color: #f0c4c0; background: #fff6f4; }
.kb-item-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.kb-count { font-size: 12px; font-weight: 600; color: #3b6fd4; }
.kb-try { padding: 18px; margin-top: 16px; }
.bot-toggle {
  padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
}
.bot-toggle.on { border-color: #b7e0c4; background: #f3faf5; }
.bot-toggle.off { border-color: #f0c4c0; background: #fff6f4; }
.bot-toggle .ai-toggle { font-size: 16px; }
.source-box {
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc;
}
.source-picks { display: grid; gap: 10px; }
.source-picks .checks { width: 100%; }
[data-theme="dark"] .source-box { background: #121822; }
.kb-gpt-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.kb-gpt-form input[type="password"] { min-width: 220px; }
.kb-list { display: flex; flex-direction: column; gap: 10px; }
.kb-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
}
.kb-item.active { border-color: var(--navy); background: #f3f6fb; }
.kb-preview { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.kb-qlist { margin: 8px 0 0; padding: 0 0 0 18px; color: var(--ink); font-size: 13px; line-height: 1.45; }
.kb-qlist li { padding: 3px 0; }
.faq-pairs { display: grid; gap: 10px; max-height: 62vh; overflow: auto; padding-right: 4px; }
.faq-pair {
  display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff;
}
.faq-n { font-size: 12px; font-weight: 700; color: var(--muted); }
.kb-ask { display: flex; gap: 8px; }
.kb-ask input { flex: 1; }
.kb-answer { margin-top: 12px; padding: 12px 14px; background: #f3f6fb; border-radius: 12px; line-height: 1.5; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.token-stat { display: grid; gap: 16px; }
.token-stat h2 { margin: 4px 0 10px; }
.token-stat h2 small { font-size: 16px; font-weight: 500; color: var(--muted); }
.token-split { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.token-split > div { background: #f3f6fb; border-radius: 12px; padding: 12px; }
.token-split strong { display: block; margin-top: 4px; font-size: 18px; }
.ai-toggle { font-size: 16px; }
.plan-quota { margin-top: 12px; }
.plan-quota input[type="number"] { width: 140px; }
@media (max-width: 980px) {
  .token-split { grid-template-columns: 1fr 1fr; }
}
.dash-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.dash-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; min-height: 68px;
}
.dash-tile:hover { box-shadow: var(--shadow-2); text-decoration: none; border-color: #d7dbe3; }
.dash-tile .ico {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
}
.dash-tile .ico svg { width: 20px; height: 20px; }
.dash-tile strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.35; }
.dash-tile .chev { margin-left: auto; color: #c5cad3; font-size: 18px; font-weight: 400; }
.dash-tile.hue-0 .ico { background: #eef3fb; color: #3b6fd4; }
.dash-tile.hue-1 .ico { background: #eef8f2; color: #0f9f6e; }
.dash-tile.hue-2 .ico { background: #f3eefb; color: #7c3aed; }
.dash-tile.hue-3 .ico { background: #fff4e8; color: #d97706; }
.dash-tile.hue-4 .ico { background: #fdecef; color: #e31b23; }
.dash-tile.hue-5 .ico { background: #e8f6fb; color: #0891b2; }
.stat-card { padding: 18px 20px; }
.stat-card h2 { margin: 8px 0 0; font-size: 28px; letter-spacing: -.03em; font-weight: 700; }
.stat-card .muted { margin: 8px 0 0; }
.theme-switch {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px;
  margin: 0 4px 12px; padding: 4px; background: rgba(255,255,255,.16); border-radius: 12px;
}
.theme-switch button {
  border: 0; background: transparent; color: #fff; font: inherit;
  font-size: 12px; font-weight: 700; padding: 7px 4px; border-radius: 9px; cursor: pointer;
}
.theme-switch button.on { background: #fff; color: #1d4ed8; }
[data-theme="dark"] {
  --ink: #e8eef6;
  --muted: #9aa6b8;
  --paper: #0f141c;
  --card: #171d28;
  --line: #2a3344;
  --navy: #60a5fa;
  --navy-2: #93c5fd;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --shadow-2: 0 12px 32px rgba(0,0,0,.45);
}
[data-theme="dark"] body,
[data-theme="dark"] .main { background: var(--paper); color: var(--ink); }
[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #1e3a5f 0%, #152a45 100%);
}
[data-theme="dark"] .card,
[data-theme="dark"] .panel,
[data-theme="dark"] .hero-card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .dash-tile,
[data-theme="dark"] .kb-item,
[data-theme="dark"] .faq-pair,
[data-theme="dark"] .industry-card,
[data-theme="dark"] .plan-card,
[data-theme="dark"] .feature,
[data-theme="dark"] .plan,
[data-theme="dark"] .filter-chip,
[data-theme="dark"] .btn-ghost,
[data-theme="dark"] .inbox-shell,
[data-theme="dark"] .inbox-list,
[data-theme="dark"] .inbox-chat,
[data-theme="dark"] .inbox-compose,
[data-theme="dark"] .inbox-side,
[data-theme="dark"] .inbox-chat-hd { background: var(--card); color: var(--ink); }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #121822; color: var(--ink); border-color: var(--line);
}
[data-theme="dark"] .table th,
[data-theme="dark"] .table td { border-color: var(--line); }
[data-theme="dark"] .settings-tabs { border-color: var(--line); }
[data-theme="dark"] .settings-tabs a.active { color: #fff; border-bottom-color: var(--navy); }
[data-theme="dark"] .dash-tile:hover { border-color: #3b4a62; }
[data-theme="dark"] .dash-tile.hue-0 .ico { background: #1c2a44; color: #93c5fd; }
[data-theme="dark"] .dash-tile.hue-1 .ico { background: #163028; color: #6ee7b7; }
[data-theme="dark"] .dash-tile.hue-2 .ico { background: #2a2040; color: #c4b5fd; }
[data-theme="dark"] .dash-tile.hue-3 .ico { background: #3a2a18; color: #fbbf24; }
[data-theme="dark"] .dash-tile.hue-4 .ico { background: #3a1c22; color: #fca5a5; }
[data-theme="dark"] .dash-tile.hue-5 .ico { background: #163038; color: #67e8f9; }
[data-theme="dark"] .token-split > div,
[data-theme="dark"] .kb-answer,
[data-theme="dark"] .kb-item.active { background: #121822; }
[data-theme="dark"] .inbox-thread { background: #121822; }
[data-theme="dark"] .ib-row.visitor .ib { background: #243044; }
[data-theme="dark"] .ib-row.ai .ib { background: #1b2433; border-color: var(--line); }
[data-theme="dark"] .ib-row.agent .ib { background: #163028; }
[data-theme="dark"] .list-item:hover,
[data-theme="dark"] .inbox-item:hover { background: #1c2533; }
[data-theme="dark"] .list-item.active,
[data-theme="dark"] .inbox-item.active { background: #243044; }
[data-theme="dark"] .progress { background: #243044; }
[data-theme="dark"] .alert-error { background: #3a1c22; color: #fecaca; }
[data-theme="dark"] .alert-ok { background: #163028; color: #a7f3d0; }
[data-theme="dark"] .theme-switch { background: rgba(255,255,255,.1); }
[data-theme="dark"] .filter-chip.active { background: #1c2a44; border-color: #3b82f6; color: #93c5fd; }
[data-theme="dark"] .sidebar .btn-ghost { background: #fff; color: #1d4ed8; }
[data-theme="dark"] .acct-pop {
  background: #1b2433; color: #e5edf8; border-color: #2d3b52;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .35);
}
[data-theme="dark"] .acct-menu.open .acct-trig { background: #1b2433; color: #e5edf8; }
[data-theme="dark"] .acct-menu.open .acct-trig-meta em { color: #94a3b8; }
[data-theme="dark"] .sidebar .acct-pop a { color: #93c5fd; }
[data-theme="dark"] .sidebar .acct-pop a:hover { background: #243044; color: #bfdbfe; }
[data-theme="dark"] .acct-pop button[type="submit"] { color: #fca5a5; }
[data-theme="dark"] .acct-pop button[type="submit"]:hover { background: #3a1c22; color: #fecaca; }
[data-theme="dark"] .acct-pop form { border-top-color: #2d3b52; }
[data-theme="dark"] .acct-theme { background: #121822; }
[data-theme="dark"] .acct-theme button { color: #8aa0bc; }
[data-theme="dark"] .acct-theme button.on { background: #2563eb; color: #fff; box-shadow: none; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi-card { padding: 18px 18px 14px; }
.kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.kpi-card h2 { margin: 6px 0 0; font-size: 28px; letter-spacing: -.03em; }
.kpi-spark { width: 88px; height: 32px; flex-shrink: 0; margin-top: 8px; }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; }
.kpi-trend {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px;
  font-weight: 700; font-size: 12px; background: #eef3fb; color: #3b6fd4;
}
.kpi-trend.up { background: #e7f7ef; color: #0f9f6e; }
.kpi-trend.down { background: #fdecef; color: #e31b23; }
.kpi-trend.flat { background: #f1f5f9; color: #64748b; }
.dash-row { display: grid; grid-template-columns: 1.4fr .8fr; gap: 14px; margin-bottom: 14px; }
.dash-row.three { grid-template-columns: 1fr 1fr 1fr; }
.dash-row.mix { grid-template-columns: 1.6fr .8fr; }
.dash-panel { padding: 16px 18px 18px; min-width: 0; }
.dash-panel-hd { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.dash-panel h3 { margin: 0; font-size: 16px; }
.dash-panel .muted { margin: 4px 0 0; font-size: 13px; }
.dash-chart { position: relative; height: 220px; }
.dash-chart.tall { height: 280px; }
.dash-chart.donut { height: 200px; }
.dash-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.dash-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dash-legend li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; }
.dash-legend i { width: 10px; height: 10px; border-radius: 99px; display: block; }
.dash-legend em { color: var(--muted); font-style: normal; }
.side-stats { display: flex; flex-direction: column; }
.side-stat {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.side-stat:first-of-type { border-top: 0; }
.side-stat strong { display: block; font-size: 22px; margin-top: 4px; letter-spacing: -.03em; }
.quota-block { padding: 10px 0 14px; }
.quota-block strong { display: block; margin: 4px 0 8px; font-size: 16px; }
.quota-block .progress { margin: 0; }
.price-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.price-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.price-table { margin: 0; }
.price-table th, .price-table td { padding: 8px; vertical-align: middle; }
.price-table input {
  width: 100%; min-width: 88px; border: 1px solid transparent; background: transparent;
  padding: 8px 10px; border-radius: 8px; color: inherit;
}
.price-table input:focus { border-color: var(--line); background: #fff; }
.price-table td:nth-child(1) { min-width: 120px; }
.price-table td:nth-child(2) { min-width: 180px; }
.price-table td:nth-child(3) { min-width: 90px; }
.price-table td:nth-child(4) { min-width: 150px; }
.price-table td:nth-child(5) { min-width: 160px; }
.price-actions { margin-top: 14px; }
.price-io {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  padding: 14px 16px; margin-bottom: 14px;
}
.price-io > div { flex: 1; min-width: 220px; }
.price-io input[type="file"] { max-width: 260px; }
.logo-card {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; border: 1px solid #d5e4f8; border-radius: 16px;
  background: #f4f8ff;
}
.logo-preview {
  width: 132px; height: 76px; flex-shrink: 0;
  display: grid; place-items: center;
  background: #fff; border: 1px solid #d5e4f8; border-radius: 12px; overflow: hidden;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.logo-preview.empty span { font-size: 12px; font-weight: 600; color: #7b93b4; }
.logo-meta { min-width: 0; display: grid; gap: 8px; }
.logo-meta .muted { margin: 0; }
.logo-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-pick { position: relative; overflow: hidden; cursor: pointer; }
.logo-pick input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0;
}
.avatar-preview {
  width: 80px; height: 80px; border-radius: 50%;
  background: #e8eef6; box-shadow: inset 0 0 0 1px #d5e4f8;
}
.avatar-preview .avatar,
.avatar-preview img {
  width: 100%; height: 100%; border-radius: 50%;
  font-size: 22px; object-fit: cover; background: #dbe7f8; color: #1d4ed8;
}
.form-grid h3 { margin: 10px 0 0; font-size: 16px; letter-spacing: -.02em; }
.form-grid > h3:first-child { margin-top: 0; }
.account-email {
  margin: 0; padding: 10px 12px; border-radius: 12px;
  background: #fff; border: 1px solid #d5e4f8; color: #475569; font-size: 13px;
}
.account-email strong { color: #1e3a5f; font-weight: 600; }
.pass-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pass-grid label { display: block; margin-bottom: 6px; }
[data-theme="dark"] .account-email { background: #121822; border-color: #2d3b52; color: #94a3b8; }
[data-theme="dark"] .account-email strong { color: #e5edf8; }
[data-theme="dark"] .avatar-preview { background: #1b2433; box-shadow: inset 0 0 0 1px #2d3b52; }
[data-theme="dark"] .avatar-preview .avatar { background: #243044; color: #93c5fd; }
@media (max-width: 720px) {
  .pass-grid { grid-template-columns: 1fr; }
}
[data-theme="dark"] .logo-card { background: #1b2433; border-color: #2d3b52; }
[data-theme="dark"] .logo-preview { background: #121822; border-color: #2d3b52; }
[data-theme="dark"] .logo-preview.empty span { color: #8aa0bc; }
.task-groups .checks { display: flex; align-items: center; gap: 8px; }
.notify-groups, .notify-events { display: grid; gap: 8px; }
.notify-group, .notify-event {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border: 1px solid #d5e4f8; border-radius: 12px;
  background: #f4f8ff; margin: 0;
}
.notify-group span, .notify-event span { display: grid; gap: 2px; min-width: 0; }
.notify-group em, .notify-event em { font-style: normal; font-size: 12px; color: var(--muted); }
.notify-form .checks { align-items: flex-start; }
.smtp-modes { display: grid; gap: 8px; }
.smtp-box {
  display: grid; gap: 12px; padding: 14px 16px;
  border: 1px solid #d5e4f8; border-radius: 14px; background: #f4f8ff;
}
[data-theme="dark"] .smtp-box { background: #1b2433; border-color: #2d3b52; }
[data-theme="dark"] .notify-group,
[data-theme="dark"] .notify-event { background: #1b2433; border-color: #2d3b52; }
[data-theme="dark"] .price-table input:focus { background: #121822; }
.zalo-groups { display: grid; gap: 10px; }
.zalo-group {
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc;
}
.zalo-group .kicker { margin-bottom: 8px; }
.zalo-group-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zalo-group-fields .form-row { margin: 0; }
@media (max-width: 720px) { .zalo-group-fields { grid-template-columns: 1fr; } }
[data-theme="dark"] .zalo-group { background: #121822; }
.zalo-chat-wrap {
  margin-top: 10px; max-height: 420px; overflow: auto;
  border: 1px solid var(--line); border-radius: 12px;
}
.zalo-chat { width: 100%; border-collapse: collapse; font-size: 13px; }
.zalo-chat th, .zalo-chat td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.zalo-chat th { position: sticky; top: 0; background: #f8fafc; color: var(--muted); font-weight: 600; font-size: 12px; }
.zalo-chat td:first-child { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.zalo-chat td:last-child { word-break: break-word; }
.zalo-chat .zalo-dir {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: #e8eef7; color: #334155;
}
.zalo-chat .role-user .zalo-dir { background: #dbeafe; color: #1d4ed8; }
.zalo-chat .role-bot .zalo-dir { background: #dcfce7; color: #15803d; }
.zalo-chat .role-miss .zalo-dir { background: #fef3c7; color: #b45309; }
[data-theme="dark"] .zalo-chat th { background: #121822; }
[data-theme="dark"] .zalo-chat .zalo-dir { background: #243044; color: #dbe4f0; }
[data-theme="dark"] .zalo-chat .role-user .zalo-dir { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .zalo-chat .role-bot .zalo-dir { background: #163028; color: #6ee7b7; }
[data-theme="dark"] .zalo-chat .role-miss .zalo-dir { background: #3a2a12; color: #fbbf24; }
.zalo-log {
  list-style: none; margin: 10px 0 0; padding: 0; max-height: 380px; overflow: auto;
  border: 1px solid var(--line); border-radius: 12px; background: #0f141c;
}
.zalo-log li {
  display: grid; grid-template-columns: 138px 1fr; gap: 6px 10px;
  padding: 8px 12px; border-bottom: 1px solid #243044; color: #dbe4f0; font-size: 12px; line-height: 1.4;
}
.zalo-log li:last-child { border-bottom: 0; }
.zalo-log time { color: #8b9bb4; font-variant-numeric: tabular-nums; }
.zalo-log strong { color: #93c5fd; font-size: 12px; }
.zalo-log span { grid-column: 2; color: #c5d0de; word-break: break-word; }
.zalo-log .lv-warn strong, .zalo-log .lv-warn { color: #fbbf24; }
.zalo-log .lv-error strong { color: #fca5a5; }
.zalo-log .lv-ok strong { color: #6ee7b7; }
[data-theme="dark"] .zalo-log { background: #0b1018; }
@media (max-width: 1100px) {
  .kpi-grid, .dash-row, .dash-row.three, .dash-row.mix, .dash-split { grid-template-columns: 1fr; }
}
[data-theme="dark"] .kpi-trend { background: #1c2a44; color: #93c5fd; }
[data-theme="dark"] .kpi-trend.up { background: #163028; color: #6ee7b7; }
[data-theme="dark"] .kpi-trend.down { background: #3a1c22; color: #fca5a5; }
[data-theme="dark"] .kpi-trend.flat { background: #243044; color: #9aa6b8; }
