/* ═══════════ Adveronix — светлая официальная тема ═══════════ */
:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #0f1419;
  --hint: #8a94a0;
  --accent: #3390ec;
  --accent-soft: rgba(51, 144, 236, 0.10);
  --accent-grad: linear-gradient(135deg, #3390ec 0%, #6bb6ff 100%);
  --ok: #22b07d;
  --ok-soft: rgba(34, 176, 125, 0.10);
  --warn: #e8a13a;
  --warn-soft: rgba(232, 161, 58, 0.12);
  --danger: #e5534b;
  --danger-soft: rgba(229, 83, 75, 0.10);
  --border: #e8ecf1;
  --shadow: 0 1px 3px rgba(15, 20, 25, 0.06), 0 4px 14px rgba(15, 20, 25, 0.04);
  --radius: 16px;
  --radius-sm: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#app { max-width: 480px; margin: 0 auto; padding: 0 14px 92px; }

/* ── Шапка ── */
.header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 4px 14px;
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(var(--bg) 85%, transparent);
}
.logo {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--accent-grad);
  color: #fff; font-size: 23px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(51, 144, 236, 0.35);
  flex-shrink: 0;
  background-size: cover; background-position: center;
}
.header-text { flex: 1; min-width: 0; }
.title { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.subtitle { font-size: 12px; color: var(--hint); }
.header-balance {
  font-size: 14px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px; border-radius: 20px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Нижняя навигация ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav-btn {
  background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 54px; padding: 5px 4px; border-radius: 10px;
  color: var(--hint); transition: color 0.15s;
}
.nav-btn.active { color: var(--accent); }
.nav-ico { font-size: 20px; line-height: 1; }
.nav-lbl { font-size: 10px; font-weight: 600; }
.hidden { display: none !important; }

/* ── Карточки ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.card-hero {
  background: var(--accent-grad);
  border: none; color: #fff;
  text-align: center; padding: 26px 16px;
}
.card-hero .label { color: rgba(255,255,255,0.8); font-size: 13px; margin-bottom: 6px; }
.card-hero .big { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.card-hero .sub { color: rgba(255,255,255,0.85); font-size: 13px; margin-top: 4px; }

/* ── Строки профиля ── */
.row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--border);
  font-size: 15px; gap: 10px;
}
.row:last-child { border-bottom: none; }
.row .label { color: var(--hint); flex-shrink: 0; }
.row .value { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.row .value.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 13px; }

/* ── Типографика ── */
.greeting { font-size: 21px; font-weight: 800; letter-spacing: -0.3px; }
.username { color: var(--hint); font-size: 14px; margin: 2px 0 14px; }
.section-title { font-size: 16px; font-weight: 800; margin: 18px 2px 10px; letter-spacing: -0.2px; }
.hint { font-size: 13px; color: var(--hint); line-height: 1.5; }
.hint a { color: var(--accent); text-decoration: none; }
.hint code, .mono-box {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 7px; border-radius: 6px; font-size: 12px;
}
.empty { text-align: center; color: var(--hint); padding: 44px 20px; font-size: 14px; line-height: 1.6; }
.loader { text-align: center; padding: 60px 0; color: var(--hint); font-size: 15px; }

/* ── Кнопки ── */
.btn {
  display: block; width: 100%;
  padding: 13px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff;
  border: 0; font-size: 15px; font-weight: 700; cursor: pointer;
  margin: 8px 0; transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); opacity: 0.9; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-secondary { background: var(--accent-soft); color: var(--accent); }
.btn-ok { background: var(--ok); }
.btn-danger { background: var(--danger); }
.btn-small { display: inline-block; width: auto; padding: 8px 14px; font-size: 13px; margin: 0; }
.back {
  color: var(--accent); background: none; border: 0;
  font-size: 15px; font-weight: 600; padding: 6px 0 12px; cursor: pointer;
}

/* ── Инпуты ── */
input, select, textarea {
  width: 100%; padding: 13px 14px;
  background: var(--card); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; outline: none; margin-bottom: 10px;
  font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder { color: var(--hint); }
select { -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a94a0' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

/* ── Чипы и бейджи ── */
.chip {
  display: inline-block;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.neutral { background: #eef1f5; color: var(--hint); }

.trust-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 24px;
  background: rgba(255,255,255,0.2); color: #fff;
  font-weight: 800; font-size: 18px;
}

/* ── Карточка проекта/сделки ── */
.item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; margin-bottom: 10px;
}
.item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.item-ico {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}
.item-title { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { color: var(--hint); font-size: 13px; margin-bottom: 8px; overflow-wrap: anywhere; }
.item-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.item-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ── Фильтры ── */
.row-filter { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 2px; }
.filter-btn {
  background: var(--card); color: var(--hint);
  border: 1.5px solid var(--border); border-radius: 20px;
  padding: 8px 16px; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Сообщения ── */
.error-box {
  background: var(--danger-soft); color: var(--danger);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 14px; margin: 10px 0; line-height: 1.4;
}
.success-box {
  background: var(--ok-soft); color: var(--ok);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 14px; margin: 10px 0; line-height: 1.4;
}
.info-box {
  background: var(--accent-soft); color: var(--text);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 13px; margin: 10px 0; line-height: 1.5;
}

/* ── Шаги инструкции ── */
.step { display: flex; gap: 12px; padding: 10px 0; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-text { font-size: 14px; line-height: 1.5; padding-top: 3px; }

/* ── Тёмная тема Telegram (автоматически) ── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181d;
    --card: #1e242c;
    --text: #eef1f4;
    --hint: #7d8791;
    --border: #2b333d;
    --shadow: 0 1px 3px rgba(0,0,0,0.25);
    --accent-soft: rgba(51, 144, 236, 0.18);
  }
  .bottom-nav { background: rgba(30, 36, 44, 0.92); }
  .chip.neutral { background: #2b333d; }
}