/* ============================================================================
   DeliDeli — Светлая адаптивная дизайн-система (Mobile-First + Desktop)
   Вдохновлено палитрой LifeIsBiz.ru: #ffffff, #fafafa, #fff5eb, #1a1a2e,
   терракотовый градиент #FF6B35 -> #F7931E, шрифты Nunito и Montserrat.
   Полная адаптация под смартфоны (Telegram Mini Apps / MAX Mini Apps) и ПК.
   ============================================================================ */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f3f4f6;
  --bg-warm: #fff5eb;
  --bg-gradient: linear-gradient(135deg, #fff5eb 0%, #ffffff 50%, #f0f7ff 100%);

  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8a8aa3;

  --accent-primary: #FF6B35;
  --accent-secondary: #F7931E;
  --accent-gradient: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
  --accent-soft: rgba(255, 107, 53, 0.12);
  --accent-border: rgba(255, 107, 53, 0.25);
  --border-subtle: rgba(26, 26, 46, 0.08);

  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --error: #ef4444;
  --error-soft: rgba(239, 68, 68, 0.12);

  --shadow-sm: 0 2px 10px rgba(26, 26, 46, 0.05);
  --shadow-md: 0 8px 30px rgba(26, 26, 46, 0.07);
  --shadow-lg: 0 18px 50px rgba(26, 26, 46, 0.12);

  --font-display: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-gradient);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.22;
  color: var(--text-primary);
}

svg {
  flex-shrink: 0;
  vertical-align: middle;
}

img, canvas {
  max-width: 100%;
  display: block;
}

/* ============================================================================
   Кнопки и элементы управления
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  border-radius: 50px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.22s var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-sm), 0 4px 16px rgba(255, 107, 53, 0.28);
}

.btn-primary:hover {
  box-shadow: var(--shadow-md), 0 6px 22px rgba(255, 107, 53, 0.36);
}

.btn-white {
  background: #ffffff;
  color: var(--text-primary);
  border-color: rgba(26, 26, 46, 0.10);
  box-shadow: var(--shadow-sm);
}

.btn-white:hover {
  border-color: var(--accent-border);
  color: var(--accent-primary);
}

.btn-warm {
  background: var(--bg-warm);
  color: var(--accent-primary);
  border-color: var(--accent-border);
}

.btn-warm:hover {
  background: var(--accent-gradient);
  color: #ffffff;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-admin-entry {
  display: none !important;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d2d4a 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid #FF6B35 !important;
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.28) !important;
}

.btn-admin-entry.visible {
  display: inline-flex !important;
}

.admin-quick-access-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #1a1a2e 0%, #292945 100%);
  color: #ffffff;
  border-radius: 20px;
  padding: 16px 22px;
  border: 1.5px solid rgba(255, 107, 53, 0.55);
  box-shadow: var(--shadow-md);
}

.admin-quick-access-bar.visible {
  display: flex;
}

.select-pill {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid rgba(26, 26, 46, 0.12);
  padding: 8px 14px;
  border-radius: 50px;
  cursor: pointer;
  outline: none;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}

.select-pill:focus {
  border-color: var(--accent-primary);
}

/* ============================================================================
   Навигационная шапка (.navbar)
   ============================================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(26, 26, 46, 0.06);
  box-shadow: var(--shadow-sm);
  padding: 12px 0;
}

.navbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--accent-primary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-sub {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================================
   Главный контейнер (.main-container) и базовые карточки (.white-card)
   ============================================================================ */
.main-container {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.white-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px 26px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(26, 26, 46, 0.04);
}

.card-header-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.orange-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.25);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: var(--bg-warm);
  border: 1px solid var(--accent-border);
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--accent-primary);
}

.pill-badge-neutral {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tertiary);
  padding: 5px 12px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
}

.pill-badge-accent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent-primary);
  padding: 5px 13px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
}

/* ============================================================================
   Блок интерактивного обучения (.onboarding-spotlight)
   ============================================================================ */
.onboarding-spotlight {
  background: linear-gradient(135deg, #fff5eb 0%, #ffffff 70%);
  border: 2px solid var(--accent-border);
  border-radius: 24px;
  padding: 22px 24px;
  box-shadow: var(--shadow-md);
  display: none;
}

.onboarding-spotlight.visible {
  display: block;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  align-items: center;
}

.onboarding-img-box {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--accent-border);
  height: 200px;
}

.onboarding-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.onboarding-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.onboarding-step-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: #ffffff;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  box-shadow: var(--shadow-sm);
}

.onboarding-title {
  font-size: 21px;
  font-weight: 900;
  margin: 10px 0 8px;
}

.onboarding-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.onboarding-points {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.onboarding-point {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.onboarding-point-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.onboarding-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--accent-border);
  flex-wrap: wrap;
}

.step-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-dot-pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.step-dot-pill.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
}

/* ============================================================================
   Паспорт комнаты (.room-header-card)
   ============================================================================ */
.room-header-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px 26px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(26, 26, 46, 0.05);
}

.room-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.room-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 900;
  margin-bottom: 4px;
}

.room-meta-line {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.room-budget-box {
  background: var(--bg-warm);
  border: 1.5px solid var(--accent-border);
  border-radius: 20px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.room-budget-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.room-budget-val {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: var(--accent-primary);
  line-height: 1.1;
}

.room-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.mode-toggle-group {
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: 50px;
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
}

.mode-toggle-btn {
  background: transparent;
  border: none;
  padding: 9px 16px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.mode-toggle-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(255, 107, 53, 0.28);
}

.members-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.members-bar-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  margin-right: 4px;
}

.member-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 6px;
  background: var(--bg-secondary);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s;
}

.member-tag.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

.member-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: #ffffff;
  flex-shrink: 0;
}

/* ============================================================================
   Навигация по 3 этапам (.stage-tabs-grid)
   ============================================================================ */
.stage-tabs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stage-tab-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.22s var(--ease-out);
}

.stage-tab-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stage-tab-card.active {
  border-color: var(--accent-primary);
  background: linear-gradient(135deg, #fff5eb 0%, #ffffff 100%);
  box-shadow: var(--shadow-md);
}

.stage-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--bg-warm);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stage-tab-card.active .stage-icon {
  background: var(--accent-gradient);
  color: #ffffff;
}

.stage-info {
  min-width: 0;
}

.stage-num {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-primary);
}

.stage-name {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 900;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
   Баннер иллюстрации раздела (.section-illustration-banner)
   ============================================================================ */
.section-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-illustration-banner {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  min-height: 200px;
  box-shadow: var(--shadow-md);
  background: #1a1a2e;
  display: flex;
  align-items: flex-end;
}

.section-illustration-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
}

.section-illustration-overlay {
  position: relative;
  z-index: 2;
  padding: 24px 28px;
  width: 100%;
  background: linear-gradient(0deg, rgba(26, 26, 46, 0.92) 0%, rgba(26, 26, 46, 0.35) 100%);
  color: #ffffff;
}

.section-illustration-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  background: var(--accent-gradient);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.section-illustration-title {
  color: #ffffff;
  font-size: clamp(20px, 2.6vw, 25px);
  font-weight: 900;
  margin-bottom: 6px;
}

.section-illustration-sub {
  color: rgba(255, 255, 255, 0.86);
  font-size: 13.5px;
  max-width: 720px;
  line-height: 1.5;
}

/* ============================================================================
   Формы, сетки полей (.form-row-2, .form-row-3, .collapse-form)
   ============================================================================ */
.collapse-form {
  display: none;
  background: var(--bg-warm);
  border: 1.5px solid var(--accent-border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 18px;
}

.collapse-form.open {
  display: block;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.field-label {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.field-input,
.field-select {
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(26, 26, 46, 0.14);
  border-radius: 12px;
  padding: 10px 13px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.field-input:focus,
.field-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}

/* ============================================================================
   Яндекс.Карты и Голосование за локации (.poll-options-grid, .ymap-*)
   ============================================================================ */
.poll-options-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.poll-option-card {
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 18px 20px;
  border: 2px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.poll-option-card.winner {
  background: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.poll-venue-layout {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.poll-venue-photo {
  width: 116px;
  height: 86px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}

.ymap-type-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.ymap-type-btn {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1.5px solid rgba(26, 26, 46, 0.12);
  background: #ffffff;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all 0.18s;
}

.ymap-type-btn.selected {
  background: var(--bg-warm);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.ymap-interactive-box {
  position: relative;
  width: 100%;
  height: 235px;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid var(--accent-border);
  background: #eef4ec;
  cursor: crosshair;
  user-select: none;
}

.ymap-real-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

.ymap-suggest-wrap {
  position: relative;
}

.ymap-suggest-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid var(--accent-primary);
  border-radius: 14px;
  box-shadow: 0 10px 32px rgba(26, 26, 46, 0.18);
  z-index: 250;
  max-height: 245px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ymap-suggest-dropdown.open {
  display: block;
}

.ymap-suggest-item {
  padding: 10px 13px;
  border-bottom: 1px solid rgba(26, 26, 46, 0.07);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  transition: background 0.15s;
}

.ymap-suggest-item:last-child {
  border-bottom: none;
}

.ymap-suggest-item:hover,
.ymap-suggest-item:active {
  background: var(--bg-warm);
}

.ymap-suggest-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.ymap-suggest-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

.ymap-suggest-tag {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 50px;
  background: var(--bg-warm);
  color: var(--accent-primary);
  border: 1px solid var(--accent-border);
  white-space: nowrap;
  flex-shrink: 0;
}

.ymap-canvas-bg {
  width: 100%;
  height: 100%;
  display: block;
}

.ymap-overlay-controls {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  pointer-events: none;
  z-index: 4;
}

.ymap-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.92);
  padding: 4px 10px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.ymap-marker-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 12;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.28));
}

.ymap-Extracted-card {
  background: var(--bg-warm);
  border: 1.5px solid var(--accent-border);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.ymap-venue-thumb {
  width: 78px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ============================================================================
   Чек-лист, Расходы, Таблица баланса, Отчёт PNG, CPA
   ============================================================================ */
.checklist-row {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.checklist-row:last-child {
  margin-bottom: 0;
}

.expense-item-card {
  background: var(--bg-secondary);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 12px;
}

.expense-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.expense-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
}

.expense-payer-meta {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.expense-price-badge {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: var(--accent-primary);
  white-space: nowrap;
}

.consumers-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.consumer-chip {
  padding: 5px 12px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  background: #ffffff;
  color: var(--text-muted);
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.consumer-chip.selected {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
}

.balance-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.balance-table-head {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  min-width: 480px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 10px 10px;
  border-bottom: 2px solid var(--bg-tertiary);
}

.balance-table-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  min-width: 480px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--bg-tertiary);
  align-items: center;
  font-size: 13.5px;
}

.val-plus { color: var(--success); font-family: var(--font-display); font-weight: 800; text-align: right; }
.val-minus { color: var(--error); font-family: var(--font-display); font-weight: 800; text-align: right; }
.val-zero { color: var(--text-muted); font-family: var(--font-display); font-weight: 700; text-align: right; }

.report-canvas-container {
  background: var(--bg-secondary);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.report-canvas-container canvas {
  width: 100%;
  max-width: 640px;
  height: auto;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.cpa-card {
  background: linear-gradient(135deg, #fff5eb 0%, #ffffff 100%);
  border: 2px solid var(--accent-border);
  border-radius: 24px;
  padding: 24px 26px;
  box-shadow: var(--shadow-md);
}

.platform-mini-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 50px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.platform-mini-tag.tg {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.platform-mini-tag.max {
  background: rgba(255, 107, 53, 0.15);
  color: var(--accent-primary);
}

/* ============================================================================
   Админ-панель и таблицы
   ============================================================================ */
.blocked-screen-card {
  display: none;
  background: #ffffff;
  border-radius: 24px;
  padding: 36px 24px;
  border: 2px solid rgba(239, 68, 68, 0.35);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.blocked-screen-card.visible {
  display: block;
}

.admin-panel-wrapper {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.admin-panel-wrapper.visible {
  display: flex;
}

.admin-hero-banner {
  background: linear-gradient(135deg, #1a1a2e 0%, #292945 100%);
  color: #ffffff;
  border-radius: 24px;
  padding: 24px 28px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-hero-banner h2 {
  color: #ffffff;
  font-size: 22px;
  margin-bottom: 4px;
}

.admin-hero-banner p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13.5px;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.admin-kpi-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.admin-kpi-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}

.admin-kpi-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: var(--text-primary);
  margin: 4px 0;
}

.admin-kpi-value.accent {
  color: var(--accent-primary);
}

.admin-kpi-sub {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.admin-tabs-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: #ffffff;
  padding: 8px;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.admin-tab-btn {
  padding: 10px 16px;
  border-radius: 50px;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.admin-tab-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
}

.admin-tab-pane {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.admin-tab-pane.active {
  display: flex;
}

.audit-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.audit-log-item {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 14px 18px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.audit-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.audit-badge.room_create { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.audit-badge.expense, .audit-badge.qr_scan { background: rgba(255, 107, 53, 0.14); color: var(--accent-primary); }
.audit-badge.vote_match { background: rgba(16, 185, 129, 0.14); color: #059669; }
.audit-badge.sbp_settle { background: rgba(139, 92, 246, 0.14); color: #7c3aed; }
.audit-badge.gate_sub, .audit-badge.cpa_click { background: rgba(245, 158, 11, 0.16); color: #d97706; }
.audit-badge.security { background: rgba(239, 68, 68, 0.14); color: #dc2626; }

.geo-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.geo-stat-card {
  background: var(--bg-warm);
  border: 1px solid var(--accent-border);
  border-radius: 16px;
  padding: 14px 16px;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 2px solid var(--bg-tertiary);
}

.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--bg-tertiary);
  vertical-align: middle;
}

/* ============================================================================
   Модальные окна (.overlay-modal, .modal-dialog) и Уведомления (.toast-msg)
   ============================================================================ */
.overlay-modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.overlay-modal.show {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-lg);
}

.toast-msg {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  padding: 12px 20px;
  border-radius: 50px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: none;
  max-width: 92vw;
  text-align: center;
}

/* ============================================================================
   АДАПТАЦИЯ ПОД ПЛАНШЕТЫ И СМАРТФОНЫ (MOBILE RESPONSIVE <= 768px и <= 480px)
   ============================================================================ */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .navbar {
    padding: 10px 0;
  }

  .navbar-inner {
    padding: 0 12px;
    gap: 10px;
  }

  .brand-logo {
    font-size: 21px;
  }

  .brand-sub {
    display: none;
  }

  .nav-controls {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 6px;
  }

  .nav-controls .btn-sm,
  .nav-controls .select-pill {
    padding: 7px 11px;
    font-size: 12px;
  }

  .admin-quick-access-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
    border-radius: 18px;
    gap: 10px;
  }

  .admin-quick-access-bar .btn {
    width: 100%;
  }

  .main-container {
    padding: 14px 12px 84px;
    gap: 14px;
  }

  .white-card,
  .room-header-card,
  .cpa-card,
  .onboarding-spotlight {
    border-radius: 20px;
    padding: 16px 14px;
  }

  #emptyRoomsStateCard {
    padding: 28px 16px !important;
  }

  #emptyRoomsStateCard h1 {
    font-size: 23px !important;
  }

  #emptyRoomsStateCard p {
    font-size: 14px !important;
    margin-bottom: 20px !important;
  }

  #emptyRoomsStateCard .btn {
    width: 100%;
  }

  /* Обучение на мобильных */
  .onboarding-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .onboarding-img-box {
    height: 150px;
  }

  .onboarding-title {
    font-size: 18px;
  }

  /* Шапка комнаты на мобильных */
  .room-header-top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .room-title {
    font-size: 21px;
  }

  .room-budget-box {
    width: 100%;
    justify-content: space-between;
    padding: 12px 14px;
  }

  .room-budget-val {
    font-size: 22px;
  }

  .room-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .mode-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    border-radius: 16px;
  }

  .mode-toggle-btn {
    padding: 8px 8px;
    font-size: 11.5px;
    border-radius: 12px;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }

  /* 3 вкладки разделов компактно в ряд на мобильном */
  .stage-tabs-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stage-tab-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 6px;
    gap: 6px;
    border-radius: 16px;
  }

  .stage-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .stage-icon svg {
    width: 18px;
    height: 18px;
  }

  .stage-num {
    font-size: 9.5px;
  }

  .stage-name {
    font-size: 12px;
    white-space: normal;
    line-height: 1.2;
  }

  .stage-desc {
    display: none;
  }

  /* Иллюстрации разделов */
  .section-illustration-banner {
    min-height: 155px;
    border-radius: 18px;
  }

  .section-illustration-overlay {
    padding: 16px 14px;
  }

  .section-illustration-title {
    font-size: 18px;
  }

  .section-illustration-sub {
    font-size: 12px;
  }

  /* Формы в 1 колонку, 16px шрифт против авто-зума iOS */
  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .field-input,
  .field-select {
    font-size: 16px;
    padding: 11px 13px;
  }

  /* Яндекс.Карты и карточки опроса */
  .ymap-type-selector {
    grid-template-columns: 1fr;
  }

  .ymap-interactive-box {
    height: 185px;
  }

  .ymap-Extracted-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .ymap-venue-thumb {
    width: 100%;
    height: 130px;
  }

  .poll-venue-layout {
    flex-direction: column;
    gap: 10px;
  }

  .poll-venue-photo {
    width: 100%;
    height: 145px;
  }

  /* Админ-панель на мобильных */
  .admin-hero-banner {
    padding: 18px 16px;
    border-radius: 20px;
  }

  .admin-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .admin-kpi-card {
    padding: 14px;
  }

  .admin-kpi-value {
    font-size: 20px;
  }

  .admin-tabs-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .admin-tabs-nav::-webkit-scrollbar {
    display: none;
  }

  /* Модальные окна в формате нижнего шторки (Bottom Sheet) на смартфонах */
  .overlay-modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal-dialog {
    border-radius: 22px 22px 0 0;
    max-width: 100%;
    max-height: 92vh;
    padding: 18px 15px 26px;
  }
}

@media (max-width: 400px) {
  .admin-kpi-grid {
    grid-template-columns: 1fr;
  }
}
