/* Shop admin + public site. One stylesheet, dark by default, light when the
   visitor's system asks for it. */
:root {
  --bg: #0f1621;
  --bg-soft: #16202e;
  --panel: #1b2736;
  --panel-2: #22303f;
  --line: #2c3c50;
  --text: #e8eef6;
  --muted: #93a4b8;
  --accent: #f0a04b;
  --accent-ink: #1a1206;
  --good: #4ec9a5;
  --bad: #f1666f;
  --warn: #e8c33d;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f5f9; --bg-soft: #ffffff; --panel: #ffffff; --panel-2: #f6f8fb;
    --line: #dde3ec; --text: #16202e; --muted: #61708a; --accent: #d97a1d;
    --accent-ink: #fff; --shadow: 0 8px 24px rgba(20, 30, 50, .08);
  }
}
:root[data-theme="light"] {
  --bg: #f3f5f9; --bg-soft: #ffffff; --panel: #ffffff; --panel-2: #f6f8fb;
  --line: #dde3ec; --text: #16202e; --muted: #61708a; --accent: #d97a1d;
  --accent-ink: #fff; --shadow: 0 8px 24px rgba(20, 30, 50, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Georgian",
        "BPG Nino Mtavruli", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ── shell ─────────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex: 0 0 232px; background: var(--bg-soft);
  border-right: 1px solid var(--line); padding: 18px 14px; position: sticky;
  top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand-dot {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  background: linear-gradient(135deg, var(--accent), #e2673c);
  display: grid; place-items: center; color: var(--accent-ink); font-weight: 700;
}
.brand b { display: block; font-size: .95rem; }
.brand span { color: var(--muted); font-size: .75rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  padding: 9px 11px; border-radius: 10px; color: var(--text);
  display: flex; align-items: center; gap: 9px; font-size: .9rem;
}
.nav a:hover { background: var(--panel); text-decoration: none; }
.nav a.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav .pill {
  margin-left: auto; background: var(--bad); color: #fff; border-radius: 999px;
  padding: 0 7px; font-size: .7rem; font-weight: 700;
}
.main { flex: 1; min-width: 0; padding: 22px 26px 60px; }
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.topbar .grow { flex: 1; }

/* ── pieces ────────────────────────────────────────────────────────── */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card > h2 { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat .k { color: var(--muted); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .05em; }
.stat .v { font-size: 1.5rem; font-weight: 700; margin-top: 2px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { min-width: 0; }

label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
input, textarea, select {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  font: inherit;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
textarea { min-height: 96px; resize: vertical; }
.field { margin-bottom: 12px; }
.field.inline { flex: 1 1 180px; margin-bottom: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 0;
  border-radius: 10px; padding: 9px 15px; font: inherit; font-weight: 600;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.good { background: var(--good); color: #05231b; }
.btn.sm { padding: 5px 10px; font-size: .82rem; border-radius: 8px; }

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .76rem;
  text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: var(--panel-2); }
.table-wrap { overflow-x: auto; margin: 0 -18px -16px; padding: 0 18px; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: .74rem; font-weight: 600; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--muted);
}
.tag.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.tag.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

.flash {
  background: color-mix(in srgb, var(--good) 15%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--good) 40%, transparent);
  border-radius: 10px; padding: 9px 13px; margin-bottom: 14px; font-size: .88rem;
}
.thumb { width: 54px; height: 54px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--line); }
details > summary { cursor: pointer; padding: 6px 0; font-weight: 600; }

/* ── login ─────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; }
.err { color: var(--bad); font-size: .85rem; margin-bottom: 10px; }

/* ── public site ───────────────────────────────────────────────────── */
.public {
  max-width: 760px; margin: 0 auto; padding: 56px 16px 80px;
}
.hero { text-align: center; margin-bottom: 34px; }
.hero .logo {
  width: 84px; height: 84px; border-radius: 24px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--accent), #e2673c);
  display: grid; place-items: center; font-size: 2.2rem; box-shadow: var(--shadow);
}
.hero h1 { font-size: 2rem; }
.hero p { color: var(--muted); margin: 6px 0 0; }
.contact-list { display: grid; gap: 10px; }
.contact {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.contact .ico { font-size: 1.3rem; width: 34px; text-align: center; }
.contact .who { flex: 1; min-width: 0; }
.contact .who b { display: block; font-size: .95rem; }
.contact .who span { color: var(--muted); font-size: .82rem; }
.cta {
  display: block; text-align: center; background: var(--accent);
  color: var(--accent-ink); font-weight: 700; padding: 15px; border-radius: var(--radius);
  margin: 22px 0; font-size: 1.05rem;
}
.cta:hover { text-decoration: none; filter: brightness(1.06); }
.foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 34px; }

@media (max-width: 860px) {
  .shell { display: block; }
  .side { width: auto; height: auto; position: static; border-right: 0;
    border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { flex: 1 1 auto; justify-content: center; }
  .main { padding: 18px 16px 50px; }
  .table-wrap { margin: 0 -18px -16px; padding: 0 18px; }
}

/* ── bot preview ───────────────────────────────────────────────────── */
.preview-wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.phone {
  flex: 0 0 380px; max-width: 100%; background: #17212b; color: #e8eef6;
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column; height: 660px; box-shadow: var(--shadow);
}
.phone-top {
  display: flex; align-items: center; gap: 9px; padding: 10px 13px;
  background: #1f2c39; border-bottom: 1px solid #0f1621;
}
.phone-top b { font-size: .9rem; }
.phone-body {
  flex: 1; overflow-y: auto; padding: 12px; display: flex;
  flex-direction: column; gap: 9px; background: #0e1621;
}
.phone-input {
  display: flex; gap: 7px; padding: 9px; background: #1f2c39;
  border-top: 1px solid #0f1621;
}
.phone-input input { background: #0e1621; border-color: #2c3c50; color: #e8eef6; }
.bubble {
  background: #1f2c39; border-radius: 13px; padding: 9px 11px; max-width: 94%;
  align-self: flex-start; font-size: .87rem; line-height: 1.45;
}
.bubble.mine { align-self: flex-end; background: #2b5278; }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-text code {
  background: #0e1621; padding: 1px 5px; border-radius: 5px; font-size: .85em;
}
.bubble-photo {
  width: 100%; border-radius: 9px; margin-bottom: 7px; display: block;
}
.kb-row { display: flex; gap: 5px; margin-top: 5px; }
.kb-btn {
  flex: 1; background: #2b5278; color: #e8eef6; border: 0; border-radius: 8px;
  padding: 8px 6px; font: inherit; font-size: .8rem; cursor: pointer;
  text-align: center; text-decoration: none;
}
.kb-btn:hover { background: #366ca0; text-decoration: none; color: #fff; }
