/* SkillsTech ReplyPilot */
:root {
  --brand: #0086ff;
  --brand-600: #006fd6;
  --brand-50: #e8f3ff;
  --ink: #0f1b2d;
  --ink-2: #44526a;
  --muted: #7a879c;
  --line: #e4e9f1;
  --bg: #f4f7fb;
  --card: #ffffff;
  --ok: #12a150;
  --ok-50: #e6f6ed;
  --warn: #c27c00;
  --warn-50: #fff5df;
  --bad: #d63a3a;
  --bad-50: #fdecec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 4px 16px rgba(15, 27, 45, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 8px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
img { max-width: 100%; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side {
  background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
}
.side .logo { padding: 4px 8px 18px; }
.side .logo img { height: 46px; width: auto; }
.side .product { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 10px 10px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: var(--ink-2); font-weight: 500; text-decoration: none;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.on { background: var(--brand-50); color: var(--brand-600); }
.nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side .foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.side .foot b { color: var(--ink); display: block; font-weight: 600; font-size: 13px; }
.main { min-width: 0; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 28px; border-bottom: 1px solid var(--line); background: var(--card);
}
.top .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.content { padding: 24px 28px 48px; max-width: 1240px; }
.btn.menu-btn { display: none; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head p { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }

.stat { padding: 16px 18px; }
.stat .k { color: var(--muted); font-size: 12.5px; }
.stat .v { font-size: 26px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .h { color: var(--muted); font-size: 12px; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-50); color: var(--ok); }
.pill.warn { background: var(--warn-50); color: var(--warn); }
.pill.bad { background: var(--bad-50); color: var(--bad); }
.pill.mute { background: var(--bg); color: var(--muted); }
.pill.blue { background: var(--brand-50); color: var(--brand-600); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--bg); color: var(--ink-2); font-size: 12px; margin: 2px 4px 2px 0; border: 1px solid var(--line); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none !important;
  background: var(--brand); color: #fff; transition: background .15s;
}
.btn:hover { background: var(--brand-600); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: var(--bad-50); color: var(--bad); border-color: #f6caca; }
.btn.danger:hover { background: #fbdcdc; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

label.lbl { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.field + .field { margin-top: 16px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; color: var(--ink); background: #fff; outline: none; transition: border .15s, box-shadow .15s;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 134, 255, .15); }
input[type=file] { font: inherit; font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); margin-top: 2px; flex: none; }
.check small { display: block; color: var(--muted); font-size: 12.5px; }
.err { color: var(--bad); font-size: 12.5px; margin-top: 5px; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13.5px; border: 1px solid; }
.alert.ok { background: var(--ok-50); border-color: #bfe8cf; color: #0b6b36; }
.alert.bad { background: var(--bad-50); border-color: #f6caca; color: #9b2121; }
.alert.info { background: var(--brand-50); border-color: #c4e0ff; color: #0b4f96; }
.alert.warn { background: var(--warn-50); border-color: #f3dca6; color: #7a4f00; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: 12px; }
.msg-body { white-space: pre-wrap; word-break: break-word; max-width: 460px; max-height: 120px; overflow: hidden; }
.num { font-variant-numeric: tabular-nums; text-align: right; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--ink-2); }
.kv span:last-child { font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- whatsapp / qr ---------- */
.qr-box { border: 1px dashed var(--line); border-radius: 14px; min-height: 320px; display: grid; place-items: center; text-align: center; padding: 20px; background: #fbfcfe; }
.qr-box img { width: 280px; height: 280px; image-rendering: pixelated; border-radius: 8px; }
.steps { margin: 0; padding-left: 20px; color: var(--ink-2); }
.steps li + li { margin-top: 6px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--brand-50); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.9s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- test bot ---------- */
.chat { background: #efeae2; border-radius: 12px; padding: 14px; min-height: 150px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 85%; padding: 8px 11px; border-radius: 10px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.bubble.me { align-self: flex-end; background: #d9fdd3; }
.bubble.bot { align-self: flex-start; background: #fff; }
.bubble .meta { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.bubble img { border-radius: 8px; margin-bottom: 6px; max-height: 180px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .art {
  background: linear-gradient(160deg, #0b1b33 0%, #0d2f5c 55%, #0086ff 140%);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth .art h2 { font-size: 30px; line-height: 1.2; font-weight: 600; max-width: 440px; }
.auth .art p { color: #c3d6f1; max-width: 420px; }
.auth .art ul { list-style: none; padding: 0; margin: 22px 0 0; color: #dce8f8; }
.auth .art li { padding: 6px 0 6px 28px; position: relative; }
.auth .art li::before { content: "✓"; position: absolute; left: 0; color: #5cb6ff; font-weight: 700; }
.auth .art .badge { display: inline-block; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 18px; }
.auth .panel { display: grid; place-items: center; padding: 32px 20px; background: var(--card); }
.auth .box { width: 100%; max-width: 400px; }
.auth .box .logo { height: 54px; margin-bottom: 22px; }
.auth .box h1 { margin-bottom: 4px; }
.auth .box .sub { color: var(--muted); margin-bottom: 22px; }

.install { max-width: 760px; margin: 32px auto; padding: 0 16px; }

/* ---------- pagination ---------- */
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pager a, .pager span { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--ink-2); }
.pager .cur { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager .dis { opacity: .5; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 10px 40px rgba(0,0,0,.15); }
  body.nav-open .side { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .top { padding: 14px 16px; }
  .content { padding: 16px 16px 40px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .table-wrap table { min-width: 620px; }
  .auth { grid-template-columns: 1fr; }
  .auth .art { display: none; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat .v { font-size: 22px; }
  .qr-box img { width: 240px; height: 240px; }
}
