/* ===== Цвета бренда Aviton =====
   Чтобы сменить цвет всего сервиса, поменяйте 3 значения ниже:
   --av-brand        — яркий цвет (логотип, значки, графики)
   --av-accent       — тёмный оттенок того же цвета (кнопки, ссылки; читается на белом)
   --av-accent-hover — ещё темнее (наведение на кнопку)
   Голубой вариант Авито: #00AAFF / #0072C6 / #005EA3 */
:root {
  --av-brand: #12C456;
  --av-accent: #00843B;
  --av-accent-hover: #006E31;

  --av-soft: color-mix(in srgb, var(--av-brand) 14%, #fff);
  --av-soft-2: color-mix(in srgb, var(--av-brand) 24%, #fff);
  --av-bg: #f4f6f9;
  --av-ink: #14161f;
  --av-muted: #5b6070;
  --av-side: #0d111b;
  --av-side-active: color-mix(in srgb, var(--av-brand) 22%, #0d111b);
  --av-card: #ffffff;
  --av-border: #e3e6ee;

  /* Bootstrap берёт цвета отсюда */
  --bs-primary: var(--av-accent);
  --bs-link-color: var(--av-accent);
  --bs-link-hover-color: var(--av-accent-hover);
  --bs-link-color-rgb: 0, 132, 59;
  --bs-primary-rgb: 0, 132, 59;
  --bs-focus-ring-color: color-mix(in srgb, var(--av-brand) 35%, transparent);
}
body { background: var(--av-bg); color: var(--av-ink); font-family: "Manrope", system-ui, sans-serif; }
a { color: var(--av-accent); }
.btn-primary { --bs-btn-bg: var(--av-accent); --bs-btn-border-color: var(--av-accent); --bs-btn-hover-bg: var(--av-accent-hover); --bs-btn-hover-border-color: var(--av-accent-hover); --bs-btn-active-bg: var(--av-accent-hover); --bs-btn-active-border-color: var(--av-accent-hover); --bs-btn-disabled-bg: var(--av-accent); --bs-btn-disabled-border-color: var(--av-accent); font-weight: 600; }
.btn-outline-primary { --bs-btn-color: var(--av-accent); --bs-btn-border-color: var(--av-accent); --bs-btn-hover-bg: var(--av-accent); --bs-btn-hover-border-color: var(--av-accent); --bs-btn-active-bg: var(--av-accent-hover); --bs-btn-active-border-color: var(--av-accent-hover); }
.text-bg-primary { background-color: var(--av-brand) !important; color: #fff !important; }
.form-control:focus, .form-select:focus { border-color: var(--av-brand); box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }
.form-check-input:checked { background-color: var(--av-accent); border-color: var(--av-accent); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 1.4rem; color: inherit; text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand:hover { color: inherit; }

/* Кабинет */
.app { display: flex; min-height: 100vh; background:
  radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--av-brand) 10%, transparent), transparent 60%),
  radial-gradient(900px 500px at 30% 110%, #e9eefb, transparent 60%), var(--av-bg); }
.topbar { display: none; }
.sidebar { width: 292px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--av-border); color: var(--av-ink);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar .side-brand { display: flex; margin: 20px 20px 10px; color: var(--av-ink); }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.sidebar .group { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: #8a90a2; margin: 18px 10px 6px; }
.sidebar a.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: #2b3040;
  text-decoration: none; font-size: .93rem; line-height: 1.25; }
.sidebar a.nav-item span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar a.nav-item:hover { background: #f2f4f8; color: var(--av-ink); }
.sidebar a.nav-item.active { background: var(--av-soft); color: var(--av-accent); font-weight: 700; }
.sidebar a.nav-item.active .ico { stroke: var(--av-accent); }
.ico { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: #7a8193; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-badge { background: var(--av-brand); color: #fff; font-size: .72rem; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.nav-tag { font-style: normal; font-size: .66rem; padding: 1px 6px; border-radius: 6px; background: #eef0f5; color: #7a8193; }
.side-foot { border-top: 1px solid var(--av-border); padding: 12px 14px 10px; }
.side-foot .me { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--av-ink); margin-bottom: 10px; }
.side-foot .ava { width: 36px; height: 36px; border-radius: 50%; background: var(--av-soft-2); color: var(--av-accent); font-weight: 800;
  display: grid; place-items: center; flex-shrink: 0; }
.side-foot .who { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.side-foot .who small { color: var(--av-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .wallet { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #f4f6fa;
  border-radius: 12px; padding: 9px 10px; margin-bottom: 8px; }
.side-foot .wallet small { display: block; color: var(--av-muted); font-size: .72rem; }
.side-foot .wallet b { font-size: 1.05rem; }
.side-foot .wallet .trial { color: var(--av-accent); }
.side-foot .support { display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--av-border); }
.side-foot .logout { color: var(--av-muted); text-decoration: none; }
.main { flex: 1; padding: 28px 34px; min-width: 0; }
.main h3.fw-bold, .main h2.fw-bold { letter-spacing: -.02em; }
.card { border: 1px solid var(--av-border); border-radius: 16px; background: var(--av-card); box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.stat { padding: 18px 20px; }
.stat .num { font-size: 1.9rem; font-weight: 800; }
.stat .lbl { color: var(--av-muted); font-size: .9rem; }
.status { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; }
.status-ok { background: var(--av-soft); color: var(--av-accent); }
.status-warn { background: #fff4dc; color: #a26a00; }
.status-error { background: #ffe5e5; color: #c62828; }
.status-new { background: #eef0f5; color: #3a3f4f; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; word-break: break-all; }
pre.log { white-space: pre-wrap; margin: 0; font-size: .85rem; color: var(--av-muted); }
.btn { border-radius: 10px; }
.form-control, .form-select { border-radius: 10px; }

/* Лендинг */
.hero { padding: 90px 0 70px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; }
.hero .lead { color: var(--av-muted); font-size: 1.2rem; max-width: 640px; }
.feature { padding: 26px; height: 100%; }
.feature .ico { font-size: 1.6rem; margin-bottom: 10px; }
.price-card { padding: 34px; }
.price-card .price { font-size: 2.6rem; font-weight: 800; }
.step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--av-brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #fff;
    border-bottom: 1px solid var(--av-border); position: sticky; top: 0; z-index: 20; }
  .topbar .brand { color: var(--av-ink); font-size: 1.2rem; }
  .sidebar { display: none; width: 100%; position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--av-border); }
  .sidebar .side-brand { display: none; }
  body.menu-open .sidebar { display: flex; }
  .main { padding: 20px 16px; }
}

/* Мессенджер */
.chat-list { max-height: 72vh; overflow-y: auto; }
.chat-row { display: block; padding: 10px 14px; border-bottom: 1px solid var(--av-border); color: inherit; text-decoration: none; }
.chat-row:hover { background: #f7f8fc; }
.chat-row.active { background: var(--av-soft); }
.msgs { max-height: 56vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.msg { max-width: 78%; padding: 8px 12px; border-radius: 12px; font-size: .95rem; }
.msg-in { background: #f1f2f6; align-self: flex-start; }
.msg-out { background: var(--av-soft-2); align-self: flex-end; }
.msg .meta { font-size: .72rem; color: var(--av-muted); margin-top: 2px; }

/* Инструменты */
.tool-card { padding: 20px; height: 100%; color: inherit; text-decoration: none; display: block; }
.tool-card:hover { border-color: var(--av-accent); }
.tool-card .ico { font-size: 1.5rem; }
textarea.mono, .out-box { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }
.out-box { white-space: pre-wrap; background: #f7f8fc; border: 1px solid var(--av-border); border-radius: 10px; padding: 12px; max-height: 60vh; overflow: auto; }
details.qs { border: 1px solid var(--av-border); border-radius: 14px; background: #fff; margin-bottom: 12px; }
details.qs > summary { cursor: pointer; padding: 16px 20px; font-weight: 700; font-size: 1.05rem; list-style: none; }
details.qs > summary::-webkit-details-marker { display: none; }
details.qs > summary::after { content: "＋"; float: right; color: var(--av-muted); }
details.qs[open] > summary::after { content: "－"; }
details.qs .qs-body { padding: 0 20px 18px; }
.avito-preview { border: 1px solid var(--av-border); border-radius: 10px; padding: 16px; background: #fff; font-family: Arial, sans-serif; font-size: 15px; line-height: 1.5; }

/* Отчёты */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; margin-bottom: 6px; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar-v { width: 100%; background: var(--av-brand); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.bar:hover .bar-v { opacity: 1; }

/* радиокнопки в формах */
.form-check input[type=radio], .form-check input[type=checkbox] { margin-right: 6px; accent-color: var(--av-accent); }

/* ===== Единые заголовки страниц и пустые экраны ===== */
.page-head { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.page-head h3 { margin: 0; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-lead { color: var(--av-muted); max-width: 820px; margin-bottom: 1.25rem; }
.help-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--av-border); }
.help-btn .ico { width: 16px; height: 16px; }
.empty-state { background: var(--av-card); border: 1px dashed var(--av-border); border-radius: 16px; padding: 40px 24px; text-align: center; }
.empty-state .empty-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--av-soft); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.empty-state .empty-ico .ico { width: 26px; height: 26px; stroke: var(--av-accent); }
.empty-state .text-muted { max-width: 520px; margin-left: auto; margin-right: auto; }
td .empty-state, .col-12 > .empty-state { border: 0; }
.price-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--av-border); }
.price-row:last-child { border-bottom: 0; }
.price-row.total { padding-top: 14px; }
.price-row .badge { font-weight: 500; vertical-align: middle; }
