/* ============================================
   Садовод — стиль v2 (аудитория 50+)
   ============================================ */

:root {
  --green:       #2e7d32;
  --green-dark:  #1b5e20;
  --green-light: #e8f5e9;
  --green-mid:   #43a047;
  --red:         #c62828;
  --red-light:   #ffebee;
  --orange:      #e65100;
  --orange-light:#fff3e0;
  --text:        #1a1a1a;
  --text-muted:  #666;
  --border:      #dde3dc;
  --bg:          #f1f5f1;
  --card-bg:     #ffffff;
  --radius:      18px;
  --shadow:      0 2px 10px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 20px rgba(0,0,0,.10);
  --header-h:    56px;
  --nav-h:       76px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 18px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-top: var(--header-h);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  min-height: 100dvh;
  line-height: 1.5;
}

a { color: var(--green); text-decoration: none; }

/* ---- Layout ---- */
.container {
  max-width: 620px;
  margin: 0 auto;
  padding: 16px 16px 0;
}

/* ---- Header ---- */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  color: #fff;
  z-index: 100;
  box-shadow: 0 2px 14px rgba(0,0,0,.22);
}
.header-inner {
  max-width: 620px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.header-back {
  background: none; border: none; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px; color: #fff;
  margin-right: 2px; opacity: .9; padding: 0;
}
.header-back:active { background: rgba(255,255,255,.18); }
.header-back svg { width: 22px; height: 22px; }
.header-snt {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -.01em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-nav { display: flex; gap: 16px; flex-shrink: 0; }

/* ---- Photo lightbox ---- */
.photo-lb { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 9000; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.photo-lb img { max-width: 96vw; max-height: 86vh; border-radius: 10px; object-fit: contain; cursor: default; }
.photo-lb-close { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,.15); border: none; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.photo-lb-close:active { background: rgba(255,255,255,.3); }
.photo-lb-close svg { width: 22px; height: 22px; stroke: #fff; }
.header-link {
  color: rgba(255,255,255,.9);
  font-size: 1rem;
  font-weight: 600;
  padding: 6px 0;
}
.header-link:hover { color: #fff; }

/* ---- Bottom nav ---- */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  padding: 4px 8px;
  padding-bottom: calc(4px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 16px rgba(0,0,0,.07);
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 600;
  text-decoration: none;
  transition: color .2s;
  padding: 4px 2px;
}
.bn-item.active { color: var(--green); }
.bn-icon {
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 32px;
  border-radius: 16px;
  transition: background .2s, transform .15s;
}
.bn-item.active .bn-icon {
  background: var(--green-light);
  transform: scale(1.05);
}
.bn-label { font-size: .72rem; }

/* ---- Cards ---- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
  border: 1px solid rgba(0,0,0,.04);
}

/* Account card */
.card-account {
  background: linear-gradient(145deg, #2e7d32 0%, #1b5e20 60%, #0f3d18 100%);
  color: #fff;
  padding: 24px;
  border: none;
  position: relative;
  overflow: hidden;
}
.card-account::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,.07);
  border-radius: 50%;
  pointer-events: none;
}
.card-account::after {
  content: '';
  position: absolute;
  bottom: -70px; left: -30px;
  width: 220px; height: 220px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
  pointer-events: none;
}
.account-plot {
  font-size: 1rem;
  opacity: .85;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  position: relative;
}
.account-owner {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 6px 0 16px;
  position: relative;
}
.account-balance {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,.15);
  border-radius: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(255,255,255,.2);
  position: relative;
}
.account-balance.negative {
  background: rgba(198,40,40,.35);
  border-color: rgba(255,255,255,.1);
}
.balance-icon { font-size: 2rem; }
.balance-info { display: flex; flex-direction: column; gap: 2px; }
.balance-label { font-size: .85rem; opacity: .9; font-weight: 600; }
.balance-amount { font-size: 2rem; font-weight: 900; line-height: 1; }

/* ---- Quick actions ---- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.qa-btn {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 4px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text);
  gap: 6px;
  text-align: center;
  border: 1.5px solid transparent;
  transition: border-color .15s, transform .1s, box-shadow .15s;
}
.qa-btn:active { transform: scale(.95); }
.qa-btn:hover  { border-color: var(--green-mid); box-shadow: 0 4px 14px rgba(46,125,50,.15); }
.qa-icon { font-size: 1.7rem; line-height: 1; }

/* ---- Sections ---- */
.section { margin-bottom: 16px; }
.section-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #1b5e20;
  background: #edf7ee;
  border-left: 5px solid var(--green);
  border-radius: 0 12px 12px 0;
  margin: 0 0 12px -4px;
  padding: 10px 16px;
}

/* ---- List items ---- */
.list-item {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.04);
  border-left: 4px solid transparent;
}
.list-item-link {
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.list-item-link:hover {
  border-left-color: var(--green-mid);
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
}
.li-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.li-meta {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.li-right { text-align: right; flex-shrink: 0; margin-left: 12px; white-space: nowrap; }
.charge-amount {
  font-weight: 800;
  color: var(--red);
  display: block;
  font-size: 1.1rem;
  white-space: nowrap;
}
.list-item > span,
.list-item > .li-right { white-space: nowrap; }
.link-more {
  display: block;
  text-align: center;
  padding: 10px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--green);
}

/* ---- Alerts ---- */
.alert {
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}
.alert::before { font-size: 1.4rem; flex-shrink: 0; }
.alert-error   { background: var(--red-light);   color: var(--red);   border: 1px solid rgba(198,40,40,.2); }
.alert-error::before { content: '⚠️'; }
.alert-success { background: var(--green-light); color: var(--green); border: 1px solid rgba(46,125,50,.2); }
.alert-success::before { content: '✅'; }
.alert-warning { background: #fff8e1; color: #e65100; border: 1px solid rgba(230,81,0,.2); }
.alert-warning::before { content: '⚠️'; }

/* ---- Auth page ---- */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 100dvh;
  background: linear-gradient(160deg, #c8e6c9 0%, #81c784 55%, #4caf50 100%);
}
.auth-card {
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 12px 48px rgba(0,0,0,.16);
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
}
.auth-logo {
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--green);
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: -.02em;
}
.auth-tagline {
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 28px;
  font-weight: 500;
}
.auth-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 22px;
  text-align: center;
  color: var(--text);
}
.auth-hint {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  text-align: center;
}
.auth-back {
  display: block;
  text-align: center;
  margin-top: 18px;
  font-size: 1rem;
  font-weight: 600;
}

/* ---- Forms ---- */
label {
  display: block;
  margin-bottom: 18px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
label input, label select, label textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1.05rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
label input:focus, label select:focus, label textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(46,125,50,.12);
}
label select { cursor: pointer; }

/* Checkbox в строку */
label.inline {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: none;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
}
label.inline input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--green);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  border-radius: 12px;
  border: none;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  font-family: inherit;
  min-height: 52px;
  letter-spacing: .01em;
}
.btn:active   { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary  {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(46,125,50,.35);
}
.btn-primary:hover { box-shadow: 0 6px 22px rgba(46,125,50,.45); }
.btn-outline  {
  background: transparent;
  border: 2px solid var(--green);
  color: var(--green);
}
.btn-danger   {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 14px rgba(198,40,40,.3);
}
.btn-full     { width: 100%; }
.btn-sm       { padding: 10px 16px; font-size: .9rem; min-height: 40px; }

/* ---- Status badges ---- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
}
.badge-pending  { background: #fff8e1; color: #e65100; }
.badge-approved { background: var(--green-light); color: var(--green); }
.badge-rejected { background: var(--red-light); color: var(--red); }
.badge-active   { background: var(--green-light); color: var(--green); }
.badge-closed   { background: #eeeeee; color: #757575; }
.badge-draft    { background: #f3e5f5; color: #6a1b9a; }

/* ---- Admin panel ---- */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  margin-bottom: 8px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  min-width: 300px;
}
.admin-table th, .admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table th {
  background: var(--green-light);
  font-weight: 800;
  color: var(--green);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.admin-table tr:hover td { background: #f8fdf8; }
.admin-table td.text-right,
.admin-table th.text-right { white-space: nowrap; }
.admin-table .td-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Page title ---- */
.page-title {
  font-size: 1.35rem;
  font-weight: 900;
  margin: 14px 0 18px;
  color: var(--text);
}

/* ---- Back link ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  margin: 10px 0 16px;
}

/* ---- Details/summary (раскрывающиеся формы) ---- */
details.card summary {
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
}
details.card summary::before { content: '＋'; font-size: 1.2rem; }
details.card[open] summary::before { content: '－'; }

/* ---- Utilities ---- */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.fw-bold     { font-weight: 800; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mb-16       { margin-bottom: 16px; }

/* ---- Stat cards (панель управления) ---- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  border: 1px solid rgba(0,0,0,.04);
}
.stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 2.4rem; font-weight: 900; line-height: 1.1; margin-top: 4px; }
.stat-sub   { font-size: .9rem; margin-top: 2px; font-weight: 600; }
.stat-green { color: var(--green); }
.stat-red   { color: var(--red); }

/* ---- Разделитель ---- */
.divider {
  border: none;
  border-top: 1.5px solid var(--border);
  margin: 16px 0;
}

/* ---- Чат ---- */
.chat-wrap  { display:flex; flex-direction:column; height:calc(100dvh - var(--header-h) - var(--nav-h) - 80px); }
.chat-msgs  { flex:1; overflow-y:auto; padding:12px 0; display:flex; flex-direction:column; gap:10px; }
.chat-msg   {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 1rem;
  line-height: 1.45;
}
.chat-msg.me    { align-self:flex-end; background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%); color:#fff; border-bottom-right-radius:4px; }
.chat-msg.other { align-self:flex-start; background:#fff; box-shadow:var(--shadow); border-bottom-left-radius:4px; }
.msg-meta   { font-size:.78rem; opacity:.75; margin-bottom:4px; font-weight:600; }
.chat-form  { display:flex; gap:10px; padding:12px 0; }
.chat-input {
  flex:1; padding:14px 18px;
  border: 2px solid var(--border);
  border-radius: 28px;
  font-size: 1rem;
  outline: none;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.chat-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(46,125,50,.1); }
.chat-send  {
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 28px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  min-width: 58px;
  box-shadow: 0 3px 10px rgba(46,125,50,.3);
  transition: box-shadow .15s, transform .1s;
}
.chat-send:active { transform: scale(.97); }

/* ---- Барахолка ---- */
.mkt-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:16px; }
.mkt-card { background:#fff; border-radius:16px; box-shadow:var(--shadow); overflow:hidden; border: 1px solid rgba(0,0,0,.04); }
.mkt-img  { width:100%; height:140px; object-fit:cover; background:var(--green-light); }
.mkt-img-ph { height:140px; display:flex; align-items:center; justify-content:center; font-size:2.5rem; background:var(--green-light); }
.mkt-body { padding:12px; }
.mkt-title { font-size:.95rem; font-weight:700; margin-bottom:4px; line-height:1.3; }
.mkt-plot  { font-size:.82rem; color:var(--text-muted); font-weight:600; }
.mkt-price { font-size:1.1rem; font-weight:900; color:var(--green); margin-top:6px; }

/* ---- Фильтр-скролл ---- */
.filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 14px;
  scrollbar-width: none;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-chip {
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  background: #fff;
  color: var(--text-muted);
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
}
.filter-chip.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  box-shadow: 0 3px 10px rgba(46,125,50,.3);
}

/* ---- Прогресс-бар голосования ---- */
.vote-bar-wrap { margin-bottom: 14px; }
.vote-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: .95rem;
  margin-bottom: 5px;
  font-weight: 600;
}
.vote-bar-track {
  height: 12px;
  background: #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}
.vote-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-mid) 100%);
  border-radius: 6px;
  transition: width .6s ease;
}

/* ---- Аварийные баннеры ---- */
.alert-banner {
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 2px solid transparent;
}
.alert-banner.emergency { background: #ffebee; border-color: var(--red); }
.alert-banner.warning   { background: #fff3e0; border-color: #e65100; }
.alert-banner.info      { background: var(--green-light); border-color: var(--green-mid); }
.ab-icon  { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.ab-title { font-size: 1rem; font-weight: 800; margin-bottom: 4px; }
.ab-title.emergency { color: var(--red); }
.ab-title.warning   { color: #e65100; }
.ab-title.info      { color: var(--green); }
.ab-body  { font-size: .95rem; line-height: 1.5; color: var(--text); }
.ab-time  { font-size: .8rem; color: var(--text-muted); margin-top: 6px; }

/* ---- Статусы заявок на ремонт ---- */
.badge-new         { background: #e3f2fd; color: #1565c0; }
.badge-in_progress { background: #fff3e0; color: #bf360c; }
.badge-done        { background: var(--green-light); color: var(--green); }
.badge-rejected    { background: var(--red-light); color: var(--red); }

/* ---- Responsive ---- */
@media (max-width: 360px) {
  html { font-size: 16px; }
  .quick-actions { grid-template-columns: repeat(5,1fr); gap:6px; }
  .qa-icon { font-size: 1.4rem; }
  .balance-amount { font-size: 1.7rem; }
}

/* ============================================
   HOME PAGE v3 — новый дизайн главной
   Классы с префиксом hp- не конфликтуют
   с остальными страницами
   ============================================ */

body.home-page { padding-top: 0; }

/* ---- Profile row ---- */
.hp-profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
}
.hp-profile-left { display: flex; align-items: center; gap: 13px; }
.hp-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(145deg, #43a047, #1b5e20);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: #fff;
  box-shadow: 0 4px 14px rgba(46,125,50,.4);
  flex-shrink: 0; text-decoration: none;
}
.hp-greeting   { font-size: 0.78rem; color: #999; font-weight: 500; margin-bottom: 2px; }
.hp-name       { font-size: 1.08rem; font-weight: 800; color: #1a1a1a; line-height: 1.2; }
.hp-plot       { font-size: 0.78rem; color: var(--green); font-weight: 600; margin-top: 2px; }

/* Bell */
.hp-bell-wrap  { position: relative; }
.hp-bell-btn {
  width: 46px; height: 46px; background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  text-decoration: none; transition: transform .15s;
}
.hp-bell-btn svg { width: 22px; height: 22px; fill: #1a1a1a; }
.hp-bell-btn:active { transform: scale(.93); }
.hp-bell-badge {
  position: absolute; top: 9px; right: 9px;
  width: 10px; height: 10px;
  background: #e53935; border-radius: 50%;
  border: 2.5px solid var(--bg);
  animation: hp-pulse 2.2s infinite;
}
@keyframes hp-pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.3); }
}

/* ---- Compact balance card ---- */
.hp-balance-card {
  background: #fff; border-radius: 20px;
  padding: 16px 20px; margin: 0 16px 16px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid rgba(0,0,0,.04);
}
.hp-balance-label {
  font-size: 0.72rem; color: #999; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px;
}
.hp-balance-amount { font-size: 1.7rem; font-weight: 900; color: #1a1a1a; letter-spacing: -.02em; }
.hp-balance-amount.negative { color: var(--red); }
.hp-balance-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 700; white-space: nowrap;
}
.hp-balance-pill.ok   { background: var(--green-light); color: var(--green); }
.hp-balance-pill.debt { background: var(--red-light);   color: var(--red); }

/* ---- Quick actions card ---- */
.hp-qa-card {
  background: #fff; border-radius: 20px;
  padding: 16px 18px 18px; margin: 0 16px 16px;
  box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,.04);
}
.hp-qa-title {
  font-size: 0.78rem; font-weight: 700; color: #aaa;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 14px;
}
.hp-qa-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; }
.hp-admin-btn {
  display: flex; align-items: center; gap: 12px;
  margin: 0 16px 16px; padding: 14px 18px;
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  color: #fff; font-size: .95rem; font-weight: 700;
  border-radius: 16px; text-decoration: none;
  box-shadow: 0 4px 14px rgba(46,125,50,.28);
}
.hp-admin-btn:active { opacity: .88; }
.hp-qa-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 4px 2px; border-radius: 14px; text-decoration: none;
  color: #444; transition: background .15s;
}
.hp-qa-item:active { background: #f0f0f0; }
.hp-icon-wrap {
  width: 58px; height: 58px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.hp-qa-item:active .hp-icon-wrap { transform: scale(.9); }
.hp-qa-label { font-size: 0.72rem; font-weight: 700; text-align: center; line-height: 1.2; }

/* ---- Carousel ---- */
.hp-carousel-wrap { margin: 0 16px 16px; }
.hp-slide {
  background: linear-gradient(140deg, #2e7d32 0%, #143d1a 100%);
  border-radius: 22px; padding: 18px 20px 16px;
  position: relative; overflow: hidden;
  height: 164px; /* фиксированная высота всех слайдов */
  display: none; flex-direction: column; justify-content: space-between;
  cursor: pointer; text-decoration: none;
}
.hp-slide.visible { display: flex; }
.hp-slide::before {
  content:''; position:absolute; top:-50px; right:-50px;
  width:190px; height:190px; background:rgba(255,255,255,.07); border-radius:50%;
}
.hp-slide::after {
  content:''; position:absolute; bottom:-60px; left:-20px;
  width:170px; height:170px; background:rgba(255,255,255,.04); border-radius:50%;
}
.hp-slide-illo {
  position:absolute; right:14px; top:50%; transform:translateY(-50%);
  opacity:.18; pointer-events:none; z-index:0;
}
.hp-slide-badge {
  display:inline-flex; align-items:center; gap:6px;
  background:rgba(255,255,255,.18); backdrop-filter:blur(6px);
  border-radius:999px; padding:4px 11px;
  font-size:0.70rem; font-weight:700; color:#fff;
  margin-bottom:8px; width:fit-content; flex-shrink:0; position:relative; z-index:1;
}
.hp-badge-dot { width:7px; height:7px; border-radius:50%; }
.hp-slide-title {
  font-size:1.05rem; font-weight:800; color:#fff; line-height:1.3;
  position:relative; z-index:1; max-width:64%; flex-shrink:0;
}
.hp-slide-body {
  font-size:0.78rem; color:rgba(255,255,255,.75); line-height:1.45;
  position:relative; z-index:1; max-width:68%; flex:1; overflow:hidden;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
}
.hp-dots { display:flex; gap:6px; align-items:center; position:relative; z-index:1; flex-shrink:0; }
.hp-dot { height:5px; border-radius:3px; transition:width .3s, background .3s; }
.hp-dot.active  { width:22px; background:rgba(255,255,255,.95); }
.hp-dot.inactive{ width:5px;  background:rgba(255,255,255,.35); }

/* ---- Events feed ---- */
.hp-events-wrap { padding: 0 16px; margin-bottom: 16px; }
.hp-events-header {
  display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;
}
.hp-events-title { font-size:1rem; font-weight:900; color:#1a1a1a; }
.hp-see-all     { font-size:0.82rem; font-weight:700; color:var(--green); text-decoration:none; }
.hp-event-card {
  background:#fff; border-radius:18px; padding:13px 15px;
  margin-bottom:10px; display:flex; align-items:center; gap:13px;
  box-shadow:var(--shadow); text-decoration:none;
  border:1px solid rgba(0,0,0,.04); transition:box-shadow .15s, transform .12s;
}
.hp-event-card:active { transform:scale(.98); box-shadow:var(--shadow-md); }
.hp-ev-icon {
  width:46px; height:46px; border-radius:15px;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.hp-ev-body   { flex:1; min-width:0; }
.hp-ev-title  { font-size:0.9rem; font-weight:700; color:#1a1a1a; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-bottom:3px; }
.hp-ev-meta   { font-size:0.74rem; color:#aaa; font-weight:600; }
.hp-ev-dot    { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.hp-ev-dot.new    { background:#e53935; }
.hp-ev-dot.active { background:#43a047; }

/* ---- Bottom nav — SVG ---- */
.bn-icon svg { display:block; }

/* ---- Accordion (аккордеон) ---- */
.hp-accordion {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,.04);
  overflow: hidden;
  margin-bottom: 16px;
}
/* убираем дефолтный маркер браузера */
.hp-accordion > summary { list-style: none; }
.hp-accordion > summary::-webkit-details-marker { display: none; }

.hp-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  font-size: 1rem;
  font-weight: 800;
  color: #1a1a1a;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  gap: 10px;
}
.hp-accordion-summary:active { background: #f8f8f8; }

.hp-acc-chevron {
  width: 22px; height: 22px;
  flex-shrink: 0;
  color: #bbb;
  transition: transform .25s ease, color .2s;
}
.hp-accordion[open] .hp-acc-chevron {
  transform: rotate(180deg);
  color: var(--green);
}

.hp-accordion-body {
  border-top: 1.5px solid var(--border);
  padding: 12px 16px 8px;
  animation: acc-open .2s ease;
}
@keyframes acc-open {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Заголовок секции внутри аккордеона */
.hp-acc-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: #bbb;
  margin-left: auto;
  padding-right: 4px;
}

/* ---- Responsive home ---- */
@media (max-width: 360px) {
  .hp-icon-wrap { width:52px; height:52px; border-radius:16px; }
  .hp-balance-amount { font-size:1.5rem; }
}

/* ── KPI Dashboard (admin/index.php) ─────────────────────── */
.kpi-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:14px; }
.kpi-card {
  background:var(--card-bg); border-radius:18px; padding:14px 16px;
  box-shadow:var(--shadow); display:flex; flex-direction:column; gap:4px;
  position:relative; overflow:hidden; text-decoration:none; color:var(--text);
}
.kpi-card::before {
  content:''; position:absolute; top:0; left:0; right:0; height:3px;
  border-radius:18px 18px 0 0;
}
.kpi-card.kpi-green::before  { background:var(--green); }
.kpi-card.kpi-red::before    { background:var(--red); }
.kpi-card.kpi-orange::before { background:var(--orange); }
.kpi-card.kpi-blue::before   { background:#1976d2; }
.kpi-icon { width:36px; height:36px; border-radius:11px; display:flex; align-items:center; justify-content:center; margin-bottom:4px; }
.kpi-label  { font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); }
.kpi-value  { font-size:1.5rem; font-weight:900; line-height:1; }
.kpi-sub    { font-size:.72rem; color:var(--text-muted); font-weight:500; }
.kpi-card.kpi-green  .kpi-value { color:var(--green); }
.kpi-card.kpi-red    .kpi-value { color:var(--red); }
.kpi-card.kpi-orange .kpi-value { color:var(--orange); }
.kpi-card.kpi-blue   .kpi-value { color:#1976d2; }

/* ── Admin nav groups (accordion-based) ────────────────── */
.ag-icon  { width:34px; height:34px; border-radius:10px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.ag-title { font-size:.85rem; font-weight:900; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); flex:1; }
.aico-wrap { width:48px; height:48px; border-radius:15px; display:flex; align-items:center; justify-content:center; }
.admin-group-body {
  display:grid; grid-template-columns:repeat(3,1fr);
  border-top:1.5px solid var(--border);
}
.admin-group-body.col2 { grid-template-columns:repeat(2,1fr); }
.admin-nav-btn {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:6px; padding:18px 8px; text-decoration:none; color:var(--text);
  font-size:.78rem; font-weight:700; text-align:center;
  border-right:1px solid var(--border); border-bottom:1px solid var(--border);
  transition:background .12s;
}
.admin-nav-btn:active { background:#f0f7ee; }
.admin-group-body.col2 > *:nth-child(2n)        { border-right:none; }
.admin-group-body.col2 > *:nth-last-child(-n+2)  { border-bottom:none; }
.admin-group-body      > *:nth-child(3n)         { border-right:none; }
.admin-group-body      > *:nth-last-child(-n+3)  { border-bottom:none; }
.admin-group-body      > *:last-child            { border-bottom:none; }

/* ── Filter chips (year selector in charges.php) ────────── */
.filter-chip {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--border);
  display: inline-block;
  transition: background .15s, color .15s;
}
.filter-chip.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* ── Meetings page (agenda, vote buttons) ───────────────── */
.agenda-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--card-bg);
}
.agenda-card-header { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.agenda-num { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.agenda-q   { font-size: 1.05rem; font-weight: 700; margin: 4px 0 0; color: var(--text); }
.agenda-descr { font-size: .88rem; color: var(--text-muted); margin: 6px 0 0; }

.protocol-id-block  { background: #f0f7ff; border-bottom: 1px solid #cce0ff; padding: 12px 16px; }
.protocol-id-title  { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #1565c0; margin-bottom: 8px; }
.protocol-id-row    { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--text); margin-bottom: 4px; }
.protocol-id-row:last-of-type { margin-bottom: 0; }
.protocol-id-note   { font-size: .72rem; color: #1565c0; margin-top: 8px; opacity: .85; }

.vote-buttons { display: flex; gap: 8px; padding: 14px 16px; flex-wrap: wrap; }
.btn-vote {
  flex: 1;
  min-width: 90px;
  padding: 14px 8px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-vote:active { opacity: .8; }
.btn-za       { background: #2e7d32; color: #fff; }
.btn-protiv   { background: #c62828; color: #fff; }
.btn-vozderzh { background: #546e7a; color: #fff; }

.vote-results-block { padding: 12px 16px 14px; }
.voted-notice { padding: 12px 16px; background: #e8f5e9; color: #2e7d32; font-weight: 600; font-size: .95rem; text-align: center; }
.no-vote-notice { padding: 12px 16px; background: var(--surface); color: var(--text-muted); font-size: .88rem; text-align: center; }
.quorum-bar { background: var(--surface); border-top: 1px solid var(--border); padding: 10px 16px; font-size: .82rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }

/* ================================================================
   Шаблон таблиц pl- (plots-list)
   ================================================================ */
.pl-outer { position: relative; border-radius: 0 0 20px 20px; overflow: hidden; }
.pl-outer::after {
  content: ''; position: absolute; top: 0; right: 0;
  width: 36px; height: calc(100% - 16px);
  background: linear-gradient(to right, transparent, rgba(255,255,255,.88));
  pointer-events: none; z-index: 2; transition: opacity .3s;
}
.pl-outer.scrolled-end::after { opacity: 0; }

.pl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--green) var(--green-light); }
.pl-wrap::-webkit-scrollbar        { height: 8px; }
.pl-wrap::-webkit-scrollbar-track  { background: var(--green-light); border-radius: 4px; }
.pl-wrap::-webkit-scrollbar-thumb  { background: var(--green); border-radius: 4px; }
.pl-wrap::-webkit-scrollbar-thumb:hover { background: var(--green-dark); }

.pl-scroll-hint {
  display: none; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px 12px; font-size: .78rem; font-weight: 700; color: var(--green);
  border-top: 1px solid var(--border); background: var(--green-light);
  border-radius: 0 0 20px 20px; letter-spacing: .01em;
}
.pl-scroll-hint svg { width: 16px; height: 16px; flex-shrink: 0; }

.pl-table { border-collapse: collapse; width: 100%; min-width: 420px; }
.pl-table th, .pl-table td { vertical-align: middle; border-bottom: 1px solid var(--border); }
.pl-table th {
  background: var(--green-light); color: var(--green); font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; padding: 10px 7px; white-space: nowrap;
}
.pl-table th:first-child { padding-left: 14px; }
.pl-table th:last-child  { padding-right: 14px; }
.pl-table td             { padding: 10px 7px; }
.pl-table td:first-child { padding-left: 14px; }
.pl-table td:last-child  { padding-right: 14px; }
.pl-table tr:last-child td { border-bottom: none; }
.pl-table tr:hover td      { background: #f8fdf8; }

.pl-col-num     { width: 26px; text-align: center; font-weight: 900; font-size: 1rem; color: var(--green-dark); }
.pl-col-area    { width: 36px; text-align: right; font-size: .9rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.pl-col-owner   { min-width: 110px; }
.pl-col-phone   { width: 116px; font-size: .88rem; white-space: nowrap; }
.pl-col-role    { width: 100px; }
.pl-col-entry   { width: 100px; }
.pl-col-kadastr { width: 108px; font-size: .78rem; color: var(--text-muted); font-weight: 500; word-break: break-all; }
.pl-col-balance { width: 88px; text-align: right; white-space: nowrap; }
.pl-col-pill    { width: 82px; text-align: center; }
.pl-col-pill1   { width: 86px; text-align: center; }
.pl-col-pill2   { width: 98px; text-align: center; }
.pl-col-pill-sm { width: 50px; text-align: center; }
.pl-col-pill-md { width: 82px; text-align: center; }
.pl-col-pill-lg { width: 98px; text-align: center; }

.pl-name-last   { font-size: .98rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.pl-name-first  { font-size: .82rem; font-weight: 500; color: var(--text-muted); line-height: 1.3; margin-top: 1px; }
.pl-name-street { font-size: .75rem; color: #aaa; font-weight: 500; margin-top: 3px; line-height: 1.2; }

.pl-entry-date { font-size: .88rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.pl-entry-prot { font-size: .72rem; color: #aaa; margin-top: 2px; }
.pl-entry-miss { font-size: .82rem; color: #e65100; font-weight: 700; }

.pl-bal { display: inline-block; padding: 4px 9px; border-radius: 8px; font-size: .8rem; font-weight: 800; white-space: nowrap; line-height: 1.2; }
.pl-bal-ok   { background: #e8f5e9; color: #2e7d32; }
.pl-bal-debt { background: #ffebee; color: #c62828; }

.role-badge      { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.role-admin      { background: #e8f5e9; color: #1b5e20; }
.role-accountant { background: #fff3e0; color: #e65100; }
.role-member     { background: #f5f5f5; color: #555; }

.meter-badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.meter-elec  { background: #fff8e1; color: #f9a825; }
.meter-water { background: #e3f2fd; color: #1565c0; }
.meter-gas   { background: #f3e5f5; color: #6a1b9a; }

.pl-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 14px; border-radius: 999px; font-size: .8rem; font-weight: 800;
  white-space: nowrap; text-decoration: none; min-height: 36px; width: 100%;
  box-sizing: border-box; cursor: pointer; border: none; font-family: inherit;
  transition: transform .1s, box-shadow .12s, opacity .1s; letter-spacing: .01em;
}
.pl-pill:active { transform: scale(.94); opacity: .85; }
.pl-pill svg    { width: 16px; height: 16px; flex-shrink: 0; }

.pl-pill-card    { background: linear-gradient(135deg, #43a047, #1b5e20); color: #fff; box-shadow: 0 2px 8px rgba(46,125,50,.30); }
.pl-pill-card:hover { box-shadow: 0 3px 12px rgba(46,125,50,.45); }

.pl-pill-receipt { background: #fff; border: 1.5px solid var(--border); color: #444; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.pl-pill-receipt:hover { border-color: var(--green-mid); color: var(--green); }

.pl-pill-copy { background: #fff; border: 1.5px solid var(--border); color: #444; box-shadow: 0 1px 4px rgba(0,0,0,.07); padding: 8px; width: 42px; min-height: 42px; }
.pl-pill-copy:hover { border-color: var(--green-mid); color: var(--green); }

.pl-pill-pay     { background: linear-gradient(135deg, #43a047, #1b5e20); color: #fff; box-shadow: 0 2px 8px rgba(46,125,50,.28); }
.pl-pill-pay:hover { box-shadow: 0 3px 12px rgba(46,125,50,.42); }

.pl-pill-accept  { background: linear-gradient(135deg, #43a047, #1b5e20); color: #fff; box-shadow: 0 2px 8px rgba(46,125,50,.28); }
.pl-pill-accept:hover { box-shadow: 0 3px 12px rgba(46,125,50,.42); }

.pl-pill-reject  { background: linear-gradient(135deg, #ef5350, #b71c1c); color: #fff; box-shadow: 0 2px 8px rgba(198,40,40,.28); }
.pl-pill-reject:hover { box-shadow: 0 3px 12px rgba(198,40,40,.42); }

.pl-pill-photo  { background: linear-gradient(135deg, #42a5f5, #1565c0); color: #fff; box-shadow: 0 2px 8px rgba(21,101,192,.25); }
.pl-pill-photo:hover { box-shadow: 0 3px 12px rgba(21,101,192,.40); }

/* ---- Action card (ac-) — стандарт для карточек с кнопками действий ----
   Структура: list-item.ac-card > .ac-head(.ac-title + .ac-sub? + .ac-amount) + .ac-meta + .ac-actions
   Кнопки: pl-pill pl-pill-accept (flex:1) + pl-pill pl-pill-reject (иконка, 44px)
-------------------------------------------------------------------- */
.ac-card { flex-direction: column; align-items: stretch; gap: 0; padding: 14px 16px 12px; }
.ac-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.ac-title { flex: 1; min-width: 0; font-weight: 700; font-size: .95rem; line-height: 1.3; }
.ac-sub { display: block; font-weight: 400; font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.ac-amount { font-size: 1.1rem; font-weight: 900; color: var(--green); white-space: nowrap; flex-shrink: 0; line-height: 1.3; }
.ac-meta { font-size: .78rem; color: var(--text-muted); line-height: 1.45; margin-bottom: 12px; }
.ac-actions { display: flex; gap: 8px; }
.ac-actions .pl-pill { flex: 1; }
.ac-actions .pl-pill-reject { flex: 0 0 44px; padding: 9px; min-width: 0; }

.btn-copy-general {
  display: inline-flex; align-items: center; gap: 8px; width: 100%;
  padding: 12px 16px; border-radius: 12px; border: 2px solid var(--border);
  background: #fff; color: var(--text); font-size: .9rem; font-weight: 700;
  cursor: pointer; font-family: inherit; margin-bottom: 2px;
  transition: border-color .12s, background .12s;
}
.btn-copy-general:hover { border-color: var(--green); background: var(--green-light); }
.btn-copy-general svg   { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; }

/* ── Sticky floating sync scrollbar ──────────────────────── */
.pl-sync-bar {
  position: fixed;
  z-index: 100;
  height: 12px;
  border-radius: 6px;
  background: #c8e6c9;
  overflow: hidden;
  display: none;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
  cursor: pointer;
}
.pl-sync-thumb {
  position: absolute;
  top: 0; bottom: 0;
  background: #43a047;
  border-radius: 6px;
  min-width: 28px;
  cursor: grab;
  transition: background .15s;
}
.pl-sync-thumb:hover { background: #2e7d32; }
.pl-sync-thumb:active { cursor: grabbing; }
