/* tg-shop-bot — единая светлая минималистичная тема */
:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d6dae1;
  --text: #1f2430;
  --muted: #6b7280;
  --muted-2: #9aa3b2;
  --accent: #2563eb;
  --accent-weak: #eff4ff;
  --accent-strong: #1d4ed8;
  --ok: #16a34a; --ok-bg: #ecfdf3;
  --warn: #b45309; --warn-bg: #fffaeb;
  --err: #dc2626; --err-bg: #fef3f2;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.04);
  --shadow-pop: 0 8px 28px rgba(16,24,40,.14);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* layout */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 520px; margin: 0 auto; padding: 0 20px; }
.section { margin-top: 28px; }
.stack > * + * { margin-top: 14px; }

/* topbar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .inner { max-width: 960px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand .dot { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; }
.brand small { color: var(--muted-2); font-weight: 500; font-size: 12px; }

/* card */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.card-h h2 { margin: 0; font-size: 16px; font-weight: 650; }
.card .hint { color: var(--muted); font-size: 13px; margin: 2px 0 14px; }

h1 { font-size: 22px; font-weight: 700; margin: 0; }
h2 { font-size: 16px; font-weight: 650; }
.muted { color: var(--muted); }
.muted-sm { color: var(--muted); font-size: 13px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); background: #fff; color: var(--text); border-radius: var(--radius-sm); padding: 9px 14px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; transition: .12s; white-space: nowrap; }
.btn:hover { background: #f3f4f6; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f3f4f6; color: var(--text); }
.btn-danger { border-color: transparent; background: transparent; color: var(--err); }
.btn-danger:hover { background: var(--err-bg); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }

/* inputs */
.field { margin-top: 12px; }
.field:first-child { margin-top: 0; }
label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 5px; }
input, textarea, select {
  width: 100%; background: #fff; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; font: inherit; font-size: 14px; outline: none; transition: .12s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { resize: vertical; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* rows */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spacer { flex: 1; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #f1f3f5; color: #4b5563; border: 1px solid var(--border); }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: #c7f0d4; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: #fde7b8; }
.badge.err { background: var(--err-bg); color: var(--err); border-color: #fcd5cf; }
.badge.accent { background: var(--accent-weak); color: var(--accent-strong); border-color: #d7e3ff; }
.dot-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: #fff; transition: .12s; }
.tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.tile.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 9px; background: #f1f3f5; border: 1px solid var(--border); margin-bottom: 10px; }
.thumb.empty { display: flex; align-items: center; justify-content: center; color: var(--muted-2); font-size: 26px; }

/* empty state */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ic { font-size: 30px; }
.empty h3 { margin: 10px 0 4px; color: var(--text); font-size: 15px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { padding: 9px 14px; border: 0; background: none; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* avatar */
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--accent-weak); color: var(--accent-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; border: 1px solid var(--border); }

/* table */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
td { padding: 9px 8px; border-bottom: 1px solid #f1f3f5; font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }

/* stepper */
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.step { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-2); }
.step .n { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: #fff; }
.step.active { color: var(--text); font-weight: 600; }
.step.active .n { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }

/* alerts */
.alert { border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; border: 1px solid; }
.alert.err { background: var(--err-bg); color: var(--err); border-color: #fcd5cf; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: #c7f0d4; }
.alert.info { background: var(--accent-weak); color: var(--accent-strong); border-color: #d7e3ff; }

/* modal */
.overlay-bg { position: fixed; inset: 0; background: rgba(16,24,40,.4); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal { background: #fff; border-radius: 16px; box-shadow: var(--shadow-pop); width: 100%; max-width: 440px; padding: 22px; }

/* misc */
.loading { color: var(--muted); padding: 40px; text-align: center; }
.spinner { width: 38px; height: 38px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
code.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f3f4f6; border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; font-size: 13px; }
