/* ================================================================
   EHSAN GROUP KZ — Design System v.13.0
   Modern Mobile-First • No-Zoom Fix • 2025
   Primary: #006b3e  Accent: #d4af37
   ================================================================ */

/* ── КРИТИЧЕСКИЙ FIX: запрет зума при фокусе на iOS ─────────── */
/* iOS зумит если font-size инпута < 16px. Устанавливаем 16px ВЕЗДЕ */
input, select, textarea, button {
  font-size: 16px !important;
  font-family: inherit;
}
/* После фокуса возвращаем визуальный размер через transform */
input:focus, select:focus, textarea:focus {
  font-size: 16px !important;
}

/* ── CSS Custom Properties ───────────────────────────────────── */
:root {
  --c-green:       #006b3e;
  --c-green-d:     #004f2d;
  --c-green-l:     #e8f5ee;
  --c-green-m:     #d1fae5;
  --c-gold:        #d4af37;
  --c-gold-d:      #b8960f;
  --c-gold-l:      #fef9e7;
  --c-red:         #ef4444;
  --c-orange:      #f97316;
  --c-yellow:      #f59e0b;
  --c-blue:        #3b82f6;
  --c-purple:      #8b5cf6;
  --c-text:        #0f172a;
  --c-text-2:      #475569;
  --c-text-3:      #94a3b8;
  --c-border:      #e2e8f0;
  --c-bg:          #f8fafc;
  --c-surface:     #ffffff;
  --c-surface-2:   #f1f5f9;

  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-full: 9999px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.07), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl:  0 20px 25px rgba(0,0,0,.08), 0 10px 10px rgba(0,0,0,.04);

  --topbar-h:  56px;
  --tabbar-h:  68px;

  /* Анимации */
  --dur: 200ms;
  --ease: cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: system-ui, -apple-system, 'Inter', 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Запрет пользовательского зума */
  touch-action: manipulation;
}

body.has-topbar { padding-top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); }
body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }

/* iOS PWA safe-area support */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
}

/* Убираем лишние отступы у main-content на iOS */
.main-content {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

a { color: var(--c-green); text-decoration: none; transition: color var(--dur); }
a:hover { color: var(--c-green-d); }

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

/* Убрать синюю подсветку касания на мобилке */
* { -webkit-tap-highlight-color: transparent; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,107,62,.2); border-radius: 99px; }

/* ================================================================
   TOPBAR
   ================================================================ */
.ehsan-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  min-height: var(--topbar-h);
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  z-index: 100;
  display: flex;
  align-items: flex-end;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: 8px;
  gap: 10px;
  /* Glassmorphism */
  background: rgba(0,107,62,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.topbar-logo {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.5px;
  color: #fff;
  flex: 1;
  line-height: 1;
}
.topbar-logo .dot { color: var(--c-gold); }

.topbar-btn {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  border: none;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--dur);
  text-decoration: none;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.topbar-btn:hover, .topbar-btn:active {
  background: rgba(255,255,255,.22);
  color: #fff;
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--c-red);
  border-radius: 50%;
  border: 2px solid var(--c-green);
}
.notif-cnt {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--c-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 1.5px solid #fff;
}

/* ================================================================
   BOTTOM TABBAR
   ================================================================ */
.ehsan-tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  min-height: var(--tabbar-h);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  cursor: pointer;
  text-decoration: none;
  color: var(--c-text-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2px;
  transition: color var(--dur);
  padding: 0;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.tab-item.active { color: var(--c-green); }
.tab-item .tab-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform var(--dur);
}
.tab-item.active .tab-icon { transform: scale(1.1); }

/* Центральные быстрые действия: SOS и QR */
.tab-item.tab-action {
  flex: 1;
  justify-content: flex-start;
  padding-top: 0;
  border: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}
.tab-action-btn,
.tab-sos-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  margin-top: -12px;
  border: 4px solid #fff;
  transition: transform var(--dur), box-shadow var(--dur);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tab-action-btn:active {
  transform: scale(.94);
}
.tab-sos-btn {
  background: linear-gradient(135deg, var(--c-red), #dc2626);
  box-shadow: 0 4px 16px rgba(239,68,68,.4);
}
.tab-sos-btn:active {
  box-shadow: 0 2px 8px rgba(239,68,68,.3);
}
.tab-qr-btn {
  background: linear-gradient(135deg, var(--c-green), #008a4f);
  box-shadow: 0 4px 16px rgba(0,107,62,.4);
}
.tab-qr-btn:active {
  box-shadow: 0 2px 8px rgba(0,107,62,.3);
}
.tab-action-label {
  font-size: 9px;
  font-weight: 700;
  margin-top: 2px;
}
.tab-sos-label {
  color: var(--c-red);
}
.tab-qr-label {
  color: var(--c-green);
}

/* ================================================================
   DRAWER (боковое меню)
   ================================================================ */
.ehsan-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur);
}
.ehsan-drawer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.ehsan-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(320px, 85vw);
  z-index: 201;
  background: var(--c-surface);
  transform: translateX(-100%);
  transition: transform 280ms var(--ease);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0 var(--r-xl) var(--r-xl) 0;
  box-shadow: var(--shadow-xl);
}
.ehsan-drawer.open { transform: translateX(0); }

.drawer-header {
  background: linear-gradient(145deg, var(--c-green), #008a4f);
  padding: 20px 20px;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  color: #fff;
  flex-shrink: 0;
}
.drawer-avatar {
  width: 56px; height: 56px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin-bottom: 10px;
  border: 2px solid rgba(255,255,255,.3);
  overflow: hidden;
}
.drawer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.drawer-name {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 3px;
}
.drawer-role {
  font-size: 12px;
  color: rgba(255,255,255,.7);
  font-weight: 600;
}
.drawer-online {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #86efac;
  margin-top: 4px;
}
.drawer-online::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
}

.drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.drawer-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--c-text-3);
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 10px 10px 4px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  color: var(--c-text-2);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--dur), color var(--dur);
  cursor: pointer;
  margin-bottom: 2px;
}
.drawer-link:hover, .drawer-link:active { background: var(--c-green-l); color: var(--c-green); }
.drawer-link.active { background: var(--c-green-m); color: var(--c-green); }
.drawer-link-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.drawer-link-badge {
  margin-left: auto;
  background: var(--c-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
}

.drawer-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
}
.drawer-lang-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.lang-btn {
  flex: 1;
  padding: 8px;
  background: var(--c-surface-2);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text-2);
  cursor: pointer;
  transition: all var(--dur);
  text-align: center;
}
.lang-btn.active { background: var(--c-green); color: #fff; border-color: var(--c-green); }

/* ================================================================
   ФОРМЫ — NO-ZOOM (font-size: 16px везде)
   ================================================================ */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-2);
  margin-bottom: 6px;
  letter-spacing: .1px;
}

/* Единый стиль для ВСЕХ инпутов — font-size: 16px критически важен */
.form-control,
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="search"],
input[type="url"],
select,
textarea {
  width: 100%;
  font-size: 16px !important; /* КРИТИЧНО: iOS не зумит если >= 16px */
  font-family: inherit;
  font-weight: 400;
  line-height: 1.4;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
  -webkit-appearance: none;
  appearance: none;
  display: block;
  /* Запрет зума через transform */
  transform-origin: left top;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--c-green);
  box-shadow: 0 0 0 3px rgba(0,107,62,.1);
  outline: none;
  /* НИКАКИХ изменений transform при фокусе */
}

textarea {
  resize: vertical;
  min-height: 88px;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { opacity: .7; }

/* Input группа (с иконкой) */
.input-group { position: relative; }
.input-group .input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-3);
  font-size: 18px;
  pointer-events: none;
  z-index: 1;
}
.input-group input { padding-left: 40px; }
.input-group .input-icon-right {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-3);
  font-size: 18px;
  cursor: pointer;
  z-index: 1;
}
.input-group .input-icon-right + input { padding-right: 40px; }

/* Grid для форм */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* ================================================================
   КНОПКИ
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }

.btn-primary { background: var(--c-green); color: #fff; }
.btn-primary:hover { background: var(--c-green-d); color: #fff; }

.btn-gold { background: var(--c-gold); color: #fff; }
.btn-gold:hover { background: var(--c-gold-d); color: #fff; }

.btn-danger { background: var(--c-red); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--c-green);
  border: 2px solid var(--c-green);
}
.btn-outline:hover { background: var(--c-green-l); color: var(--c-green); }

.btn-ghost {
  background: transparent;
  color: var(--c-text-2);
  border: 1.5px solid var(--c-border);
}
.btn-ghost:hover { background: var(--c-surface-2); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { padding: 14px 24px; font-size: 16px; border-radius: var(--r-lg); }
.btn-full { width: 100%; }

/* Ripple effect */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.2);
  opacity: 0;
  transition: opacity var(--dur);
}
.btn:active::after { opacity: 1; }

/* ================================================================
   КАРТОЧКИ
   ================================================================ */
.card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-body { padding: 16px; }
.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text);
  margin: 0;
}
.card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
}

/* Кликабельная карточка */
.card-clickable {
  cursor: pointer;
  transition: transform var(--dur), box-shadow var(--dur), border-color var(--dur);
}
.card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0,107,62,.2);
}
.card-clickable:active { transform: translateY(0) scale(.99); }

/* ================================================================
   БЕЙДЖИ / ЧИПЫ
   ================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  letter-spacing: .2px;
  white-space: nowrap;
}
.badge-green  { background: #dcfce7; color: #166534; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-gold   { background: var(--c-gold-l); color: #78350f; }

/* ================================================================
   АЛЕРТЫ
   ================================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: #f0fdf4; border-color: #86efac; color: #166534; }
.alert-error   { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }

/* ================================================================
   СТРАНИЦЫ ADMIN / ОБЩИЙ ОБЁРТОЧНЫЙ DIV
   ================================================================ */
.page-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 24px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.page-header-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--c-text);
  line-height: 1.2;
}
.page-header-sub {
  font-size: 13px;
  color: var(--c-text-3);
  margin-top: 2px;
}
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--c-text-3);
  text-decoration: none;
  margin-bottom: 8px;
  font-weight: 500;
}
.page-back:hover { color: var(--c-green); }

/* ================================================================
   СПИСОК (универсальный)
   ================================================================ */
.list-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--c-border);
  text-decoration: none;
  color: var(--c-text);
  transition: background var(--dur);
  position: relative;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover, .list-item:active { background: var(--c-surface-2); }
.list-item-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--c-green-l);
}
.list-item-main { flex: 1; min-width: 0; }
.list-item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-sub {
  font-size: 12px;
  color: var(--c-text-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.list-item-arrow {
  color: var(--c-text-3);
  font-size: 18px;
}

/* ================================================================
   ПРОГРЕСС СБОРОВ
   ================================================================ */
.progress-bar {
  height: 6px;
  background: var(--c-border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--c-green), #22c55e);
  transition: width .6s var(--ease);
  min-width: 4px;
}
.progress-fill.gold { background: linear-gradient(90deg, var(--c-gold), #fbbf24); }
.progress-fill.full { background: linear-gradient(90deg, var(--c-gold), #fbbf24); }

/* ================================================================
   KPI / STAT КАРТОЧКИ
   ================================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: 14px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 11px; font-weight: 700; color: var(--c-text-3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--c-text); line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--c-text-3); margin-top: 3px; }

/* ================================================================
   ФИЛЬТРЫ / ПОИСК
   ================================================================ */
.search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-3);
  font-size: 18px;
  pointer-events: none;
}
.search-input {
  padding-left: 40px !important;
  background: var(--c-surface) !important;
  border-color: var(--c-border) !important;
}
.search-input:focus { border-color: var(--c-green) !important; }
.search-clear {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-3);
  font-size: 18px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chips-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  margin-bottom: 14px;
}
.chips-row::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  color: var(--c-text-2);
  cursor: pointer;
  transition: all var(--dur);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover, .chip.active {
  background: var(--c-green);
  border-color: var(--c-green);
  color: #fff;
}

/* ================================================================
   ПАГИНАЦИЯ
   ================================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.page-btn {
  padding: 8px 16px;
  border-radius: var(--r-md);
  background: var(--c-green);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background var(--dur);
}
.page-btn:hover { background: var(--c-green-d); color: #fff; }
.page-info { font-size: 14px; color: var(--c-text-3); }

/* ================================================================
   SOS FAB
   ================================================================ */
.sos-fab {
  display: none; /* показывается через JS если не в таббаре */
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  right: 16px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--c-red);
  color: #fff;
  font-size: 24px;
  border: none;
  box-shadow: 0 4px 20px rgba(239,68,68,.5);
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fab-pulse 3s infinite;
  -webkit-tap-highlight-color: transparent;
}
@keyframes fab-pulse {
  0%,100% { box-shadow: 0 4px 20px rgba(239,68,68,.5); }
  50%      { box-shadow: 0 4px 30px rgba(239,68,68,.8), 0 0 0 8px rgba(239,68,68,.15); }
}

/* ================================================================
   ТОСТЫ (уведомления)
   ================================================================ */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-h) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(360px, calc(100vw - 32px));
}
.toast {
  background: #1e293b;
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in .3s var(--ease);
  pointer-events: all;
  width: 100%;
  line-height: 1.4;
}
.toast.removing { animation: toast-out .3s var(--ease) forwards; }
.toast-success { background: #166534; }
.toast-error   { background: #991b1b; }
.toast-warning { background: #854d0e; background: #92400e; }
.toast-info    { background: #1e40af; }
.toast-icon    { font-size: 18px; flex-shrink: 0; }
.toast-msg     { flex: 1; }
.toast-close   { background: none; border: none; color: rgba(255,255,255,.7); cursor: pointer; font-size: 16px; padding: 2px; margin-left: 4px; flex-shrink: 0; }

@keyframes toast-in  { from { opacity:0; transform: translateY(-12px) scale(.95); } to { opacity:1; transform:none; } }
@keyframes toast-out { from { opacity:1; transform:none; } to { opacity:0; transform: translateY(-8px); } }

/* ================================================================
   SOS МОДАЛ
   ================================================================ */
.sos-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.sos-modal-overlay.open { opacity: 1; pointer-events: all; }

.sos-modal {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: 20px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  transform: translateY(40px);
  transition: transform .3s var(--ease);
  box-shadow: var(--shadow-xl);
}
.sos-modal-overlay.open .sos-modal { transform: translateY(0); }

.sos-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--c-red);
  text-align: center;
  margin-bottom: 6px;
}
.sos-modal-sub {
  font-size: 13px;
  color: var(--c-text-3);
  text-align: center;
  margin-bottom: 18px;
}
.sos-types-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.sos-type-btn {
  background: #fef2f2;
  border: 2px solid #fca5a5;
  border-radius: var(--r-md);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--dur);
  -webkit-tap-highlight-color: transparent;
}
.sos-type-btn:hover, .sos-type-btn.selected {
  background: var(--c-red);
  border-color: var(--c-red);
  color: #fff;
}
.sos-type-icon { font-size: 26px; }
.sos-type-label { font-size: 11px; font-weight: 700; color: #991b1b; text-align: center; }
.sos-type-btn.selected .sos-type-label { color: #fff; }
.sos-send-btn {
  width: 100%;
  padding: 14px;
  background: var(--c-red);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--dur);
  margin-bottom: 10px;
}
.sos-send-btn:hover { background: #dc2626; }
.sos-cancel-btn {
  width: 100%;
  padding: 11px;
  background: var(--c-surface-2);
  color: var(--c-text-2);
  border: none;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.sos-modal-admin{max-height:calc(100vh - 34px);overflow:auto}
.sos-message-input{width:100%;border:1px solid var(--c-border);border-radius:var(--r-md);padding:12px;font:inherit;resize:vertical;margin-bottom:12px;box-sizing:border-box}
.sos-target-mode-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:12px}
.sos-target-mode-btn{border:1px solid #fecaca;background:#fff7f7;color:#991b1b;border-radius:12px;padding:10px 6px;font-size:13px;font-weight:800;cursor:pointer}
.sos-target-mode-btn.selected{background:var(--c-red);border-color:var(--c-red);color:#fff}
.sos-nearest-controls{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;margin-bottom:10px}
.sos-nearest-controls input,.sos-nearest-controls button{border:1px solid var(--c-border);border-radius:10px;padding:9px;font-size:13px;background:#fff}
.sos-nearest-controls button{background:#f3f4f6;font-weight:800;cursor:pointer}
.sos-target-list{border:1px solid var(--c-border);border-radius:14px;background:#fff;max-height:190px;overflow:auto;margin-bottom:12px}
.sos-target-list-tall{max-height:240px}
.sos-target-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid #f3f4f6;cursor:pointer}
.sos-target-row:last-child{border-bottom:0}
.sos-target-row input{width:18px;height:18px;accent-color:var(--c-red);flex-shrink:0}
.sos-target-row img{width:34px;height:34px;border-radius:50%;object-fit:cover;background:#006b3e;flex-shrink:0}
.sos-target-row span{min-width:0;display:flex;flex-direction:column;gap:2px}
.sos-target-row strong{font-size:13px;color:var(--c-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sos-target-row small{font-size:11px;color:var(--c-text-3)}
.sos-target-row-simple{padding-left:14px}
.sos-target-loading,.sos-target-empty{padding:14px;text-align:center;font-size:13px;color:var(--c-text-3)}
@media (max-width:420px){.sos-nearest-controls{grid-template-columns:1fr 1fr}.sos-nearest-controls button{grid-column:1/-1}}

/* ================================================================
   СПИННЕР / СКЕЛЕТОН
   ================================================================ */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.spinner-sm { width: 20px; height: 20px; border-width: 2.5px; }
.spinner-lg { width: 48px; height: 48px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Pulse animation for SOS sound button */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--c-text-3);
  font-size: 14px;
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton-shine {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================================================================
   АВТОРИЗАЦИЯ
   ================================================================ */
.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: linear-gradient(160deg, #f0fdf4 0%, #dcfce7 40%, #f0fdf4 100%);
}
.auth-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  padding: 28px 24px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--c-border);
}
.auth-logo {
  text-align: center;
  font-size: 32px;
  font-weight: 900;
  color: var(--c-green);
  margin-bottom: 4px;
}
.auth-logo .dot { color: var(--c-gold); }
.auth-tagline {
  text-align: center;
  font-size: 13px;
  color: var(--c-text-3);
  margin-bottom: 24px;
}
.auth-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  color: var(--c-text);
  margin-bottom: 6px;
}
.auth-subtitle {
  font-size: 14px;
  color: var(--c-text-3);
  text-align: center;
  margin-bottom: 20px;
}

/* ================================================================
   ПУСТОЕ СОСТОЯНИЕ
   ================================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}
.empty-icon   { font-size: 56px; margin-bottom: 14px; opacity: .7; }
.empty-title  { font-size: 16px; font-weight: 700; color: var(--c-text-2); margin-bottom: 6px; }
.empty-text   { font-size: 14px; color: var(--c-text-3); margin-bottom: 16px; }

/* ================================================================
   NOTIFICATIONS CENTER
   ================================================================ */
.notif-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.notif-hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, #006b3e 0%, #008a4f 62%, #0aa86a 100%);
  box-shadow: 0 16px 34px rgba(0, 107, 62, .18);
}
.notif-hero-card::after {
  content: '';
  position: absolute;
  right: -44px;
  top: -48px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
}
.notif-kicker {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: var(--r-full);
  background: rgba(212,175,55,.22);
  border: 1px solid rgba(212,175,55,.45);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .3px;
}
.notif-hero-title {
  position: relative;
  z-index: 1;
  margin: 10px 0 4px;
  font-size: 25px;
  line-height: 1.05;
  font-weight: 950;
  color: #fff;
}
.notif-hero-text {
  position: relative;
  z-index: 1;
  max-width: 290px;
  color: rgba(255,255,255,.82);
  font-size: 13px;
  font-weight: 650;
}
.notif-counter-card {
  position: relative;
  z-index: 1;
  min-width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(10px);
}
.notif-counter-card strong {
  font-size: 31px;
  line-height: 1;
  font-weight: 950;
  color: #fff;
}
.notif-counter-card span {
  margin-top: 5px;
  font-size: 10px;
  color: rgba(255,255,255,.8);
  font-weight: 800;
  text-align: center;
}
.notif-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.notif-filter-row,
.notif-type-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.notif-filter-row::-webkit-scrollbar,
.notif-type-row::-webkit-scrollbar { display: none; }
.notif-chip,
.notif-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border-radius: var(--r-full);
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-text-2);
  font-weight: 850;
  box-shadow: var(--shadow-sm);
}
.notif-chip {
  padding: 10px 12px;
  font-size: 13px;
}
.notif-type-chip {
  padding: 8px 11px;
  font-size: 12px;
}
.notif-chip span,
.notif-type-chip span {
  color: var(--c-text-3);
  font-weight: 900;
}
.notif-chip.active,
.notif-type-chip.active {
  border-color: var(--c-green);
  background: var(--c-green);
  color: #fff;
}
.notif-chip.active span,
.notif-type-chip.active span { color: rgba(255,255,255,.78); }
.notif-read-all-form { flex-shrink: 0; }
.notif-empty-card {
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.notif-list-modern {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.notif-card {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(226,232,240,.9);
  box-shadow: 0 8px 24px rgba(15,23,42,.06);
  overflow: hidden;
}
.notif-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--c-blue);
}
.notif-card-success::before { background: var(--c-green); }
.notif-card-warning::before { background: var(--c-yellow); }
.notif-card-error::before,
.notif-card-sos::before { background: var(--c-red); }
.notif-card-box::before { background: var(--c-gold); }
.notif-card-finance::before { background: #16a34a; }
.notif-card-volunteer::before { background: #8b5cf6; }
.notif-card-patient::before { background: #06b6d4; }
.notif-card.is-read { opacity: .76; }
.notif-card.is-unread {
  border-color: rgba(0,107,62,.24);
  background: linear-gradient(180deg, #fff 0%, #f5fcf8 100%);
}
.notif-card-icon {
  width: 43px;
  height: 43px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--c-surface-2);
  font-size: 22px;
}
.notif-card-body { min-width: 0; flex: 1; }
.notif-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.notif-type-label {
  color: var(--c-green);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.notif-time {
  flex-shrink: 0;
  color: var(--c-text-3);
  font-size: 11px;
  font-weight: 750;
}
.notif-card-title {
  margin: 0 0 5px;
  color: var(--c-text);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 900;
}
.notif-card-message {
  color: var(--c-text-2);
  font-size: 13px;
  line-height: 1.45;
}
.notif-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.notif-card-actions form { display: inline-flex; }
.notif-open-btn,
.notif-soft-btn,
.notif-delete-btn {
  min-height: 38px;
  border: 0;
  border-radius: 14px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}
.notif-open-btn {
  background: var(--c-green);
  color: #fff;
}
.notif-soft-btn {
  background: var(--c-green-l);
  color: var(--c-green);
}
.notif-delete-btn {
  width: 40px;
  padding: 0;
  background: #fef2f2;
  color: var(--c-red);
}
.notif-unread-dot {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c-red);
  box-shadow: 0 0 0 4px rgba(239,68,68,.12);
}
.notif-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.pagination-btn {
  padding: 9px 14px;
  background: var(--c-green);
  color: white;
  border-radius: var(--r-sm);
  font-weight: 800;
}
.pagination-btn:hover { background: var(--c-green-d); color: #fff; }
.pagination-info {
  font-size: 13px;
  color: var(--c-text-2);
  font-weight: 800;
}
@media (max-width: 520px) {
  .notif-hero-card { flex-direction: column; }
  .notif-counter-card { align-items: flex-start; min-width: 0; }
  .notif-toolbar { align-items: stretch; flex-direction: column; }
  .notif-card { padding: 13px 12px; }
}
body.native-app-mode .notif-page {
  padding-left: 12px;
  padding-right: 12px;
}
body.native-app-mode .notif-hero-card,
body.native-app-mode .notif-card,
body.native-app-mode .notif-empty-card,
body.native-app-mode .notif-pagination {
  border: 0;
  box-shadow: 0 10px 28px rgba(15,23,42,.08);
}

/* ================================================================
   ТАЙМЛАЙН
   ================================================================ */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; padding-bottom: 16px; position: relative; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13px; top: 26px;
  width: 2px;
  bottom: 0;
  background: var(--c-border);
}
.tl-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--c-border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text-3);
  z-index: 1;
}
.tl-dot.done   { background: var(--c-green); color: #fff; }
.tl-dot.active { background: var(--c-gold); color: #fff; }
.tl-dot.error  { background: var(--c-red); color: #fff; }
.tl-content    { flex: 1; padding-top: 4px; }
.tl-title      { font-size: 14px; font-weight: 700; color: var(--c-text); }
.tl-time       { font-size: 12px; color: var(--c-text-3); margin-top: 1px; }
.tl-note       { font-size: 13px; color: var(--c-text-2); margin-top: 4px; font-style: italic; }

/* ================================================================
   ФИНАНСОВЫЕ КАРТОЧКИ
   ================================================================ */
.finance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text-2);
}
.finance-row:last-child { border-bottom: none; }
.finance-row.total {
  font-weight: 800;
  color: var(--c-green);
  font-size: 16px;
  border-top: 2px solid var(--c-border);
  padding-top: 12px;
  margin-top: 4px;
}
.finance-row .value { font-weight: 700; color: var(--c-text); }
.finance-row.negative .value { color: var(--c-red); }
.finance-row.positive .value { color: var(--c-green); }

/* ================================================================
   ДИСТРИБЬЮЦИЯ (цветные бары)
   ================================================================ */
.dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dist-label { min-width: 100px; font-size: 13px; color: var(--c-text-2); }
.dist-bar-wrap { flex: 1; height: 8px; background: var(--c-surface-2); border-radius: 99px; overflow: hidden; }
.dist-bar { height: 100%; border-radius: 99px; transition: width .5s var(--ease); }
.dist-amount { min-width: 80px; text-align: right; font-size: 13px; font-weight: 700; color: var(--c-text); }

/* ================================================================
   ИНФО-СТРОКИ (key-value)
   ================================================================ */
.info-rows { display: flex; flex-direction: column; }
.info-row {
  display: grid;
  grid-template-columns: minmax(110px, 34%) minmax(0, 1fr);
  align-items: start;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--c-border);
  gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-row-label { color: var(--c-text-3); font-size: 13px; line-height: 1.35; }
.info-row-value { font-weight: 700; color: var(--c-text); text-align: left; line-height: 1.45; overflow-wrap: anywhere; word-break: normal; }
.info-row-value a { color: var(--c-green); }
.patient-qr-card { width: fit-content; margin: 14px auto 0; padding: 10px; border: 1px solid var(--c-border); border-radius: 16px; background: #fff; text-align: center; }
.patient-qr-img { width: 132px; height: 132px; display: block; border-radius: 12px; }
.patient-qr-caption { font-size: 11px; color: var(--c-text-3); margin-top: 6px; }
@media (max-width: 420px) {
  .info-row { grid-template-columns: 1fr; gap: 3px; }
  .info-row-value { font-size: 15px; }
}

/* ================================================================
   УТИЛИТЫ
   ================================================================ */
.mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.text-green { color: var(--c-green) !important; }
.text-red   { color: var(--c-red) !important; }
.text-gold  { color: var(--c-gold) !important; }
.text-muted { color: var(--c-text-3) !important; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.text-center { text-align: center; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12{ margin-top: 12px; }
.mt-16{ margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12{ margin-bottom: 12px; }
.mb-16{ margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }

/* Разделитель */
.divider { height: 1px; background: var(--c-border); margin: 12px 0; }
.divider-text {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--c-text-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  margin: 14px 0;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--c-border);
}

/* Секция */
.section { margin-bottom: 20px; }
.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--c-text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title-badge {
  font-size: 12px;
  background: var(--c-green);
  color: #fff;
  padding: 2px 10px;
  border-radius: 99px;
  font-weight: 700;
}
.section-link { font-size: 13px; color: var(--c-green); font-weight: 600; }

/* Flash messages */
.flash-success { background:#f0fdf4; border:1px solid #86efac; color:#166534; border-radius:var(--r-md); padding:10px 14px; font-size:14px; margin-bottom:12px; }
.flash-error   { background:#fef2f2; border:1px solid #fca5a5; color:#991b1b; border-radius:var(--r-md); padding:10px 14px; font-size:14px; margin-bottom:12px; }
.flash-warning { background:#fffbeb; border:1px solid #fde68a; color:#92400e; border-radius:var(--r-md); padding:10px 14px; font-size:14px; margin-bottom:12px; }
.flash-info    { background:#eff6ff; border:1px solid #93c5fd; color:#1e40af; border-radius:var(--r-md); padding:10px 14px; font-size:14px; margin-bottom:12px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-box {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--c-border);
}
.modal-title { font-size: 18px; font-weight: 800; color: var(--c-text); margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* Consent checkbox */
.check-label {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; color: var(--c-text-2); cursor: pointer; line-height: 1.5;
}
.check-label input[type="checkbox"] {
  width: 18px !important; height: 18px !important;
  min-width: 18px;
  border-radius: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: var(--c-green);
  flex-shrink: 0;
  margin-top: 1px !important;
  cursor: pointer;
}

/* ================================================================
   HOME HERO, NEWS, CONTENT ADMIN
   ================================================================ */
.page-wrap { max-width: 680px; margin: 0 auto; }

.hero {
  background: linear-gradient(160deg, #006b3e 0%, #008a4f 60%, #00a85c 100%);
  padding: 28px 20px 32px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::before,.hero::after{content:'';position:absolute;border-radius:50%;background:rgba(255,255,255,.05)}
.hero::before{top:-40px;right:-40px;width:220px;height:220px}.hero::after{bottom:-30px;left:-30px;width:160px;height:160px}
.hero-content{position:relative;z-index:1}.hero-logo{font-size:32px;font-weight:900;color:#fff;letter-spacing:-1px;margin-bottom:4px}.hero-logo .dot{color:var(--c-gold)}
.hero-tagline{font-size:14px;color:rgba(255,255,255,.8);margin-bottom:20px}.hero-stats{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.hero-stats.compact{margin:16px 0;max-width:340px}
.hero-stat{background:rgba(255,255,255,.12);border-radius:12px;padding:12px;backdrop-filter:blur(4px);border:1px solid rgba(255,255,255,.15)}
.hero-stat-val{font-size:20px;font-weight:900;color:#fff;line-height:1;margin-bottom:3px}.hero-stat-lbl{font-size:11px;color:rgba(255,255,255,.75);font-weight:600}
.hero-cta{display:flex;gap:10px;margin-top:20px}.btn-hero-primary,.btn-hero-outline{padding:12px;border-radius:12px;font-weight:800;text-align:center;text-decoration:none;display:block;touch-action:manipulation;color:#fff}.btn-hero-primary{flex:2;background:var(--c-gold)}.btn-hero-outline{flex:1;background:rgba(255,255,255,.15);border:1.5px solid rgba(255,255,255,.4)}
.filters-wrap{padding:16px 16px 0}.patients-grid{padding:16px;display:grid;grid-template-columns:1fr;gap:14px}.patient-card{background:#fff;border-radius:16px;overflow:hidden;border:1px solid var(--c-border);box-shadow:var(--shadow-sm);transition:transform .2s,box-shadow .2s;text-decoration:none;color:inherit;display:block}.patient-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-md)}.patient-card:active{transform:scale(.99)}.pc-photo,.pc-photo-ph{width:100%;height:180px}.pc-photo{object-fit:cover;background:var(--c-green-l)}.pc-photo-ph{background:linear-gradient(135deg,var(--c-green-l),var(--c-green-m));display:flex;align-items:center;justify-content:center;font-size:60px}.pc-body{padding:14px}.pc-badges{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:8px}.pc-name{font-size:16px;font-weight:800;color:var(--c-text);margin-bottom:4px;line-height:1.3}.pc-diag{font-size:13px;color:var(--c-text-3);margin-bottom:10px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.pc-city{font-size:12px;color:var(--c-text-3);margin-bottom:10px;display:flex;align-items:center;gap:4px}.pc-progress-bar{height:6px;background:var(--c-border);border-radius:99px;overflow:hidden;margin-bottom:6px}.pc-progress-fill{height:100%;border-radius:99px;background:linear-gradient(90deg,var(--c-green),#22c55e);transition:width .6s ease;min-width:4px}.pc-progress-fill.full{background:linear-gradient(90deg,var(--c-gold),#fbbf24)}.pc-progress-info{display:flex;justify-content:space-between;align-items:center}.pc-collected{font-size:15px;font-weight:800;color:var(--c-green)}.pc-pct{font-size:12px;font-weight:700;color:var(--c-text-3)}.pc-target{font-size:12px;color:var(--c-text-3)}.pc-urgent{border-color:#fca5a5;box-shadow:0 0 0 2px rgba(239,68,68,.1)}.urgent-strip{background:var(--c-red);color:#fff;font-size:11px;font-weight:700;text-align:center;padding:4px;letter-spacing:.5px}

.home-hero-slider{position:relative;min-height:calc(100svh - var(--topbar-h));background:#052f20;overflow:hidden;color:#fff}.home-hero-track,.home-hero-slide{position:absolute;inset:0}.home-hero-slide{opacity:0;pointer-events:none;transition:opacity .45s ease}.home-hero-slide.active{opacity:1;pointer-events:auto}.home-hero-picture,.home-hero-picture img{position:absolute;inset:0;width:100%;height:100%}.home-hero-picture img{object-fit:cover}.home-hero-overlay{position:absolute;inset:0;background:linear-gradient(180deg,rgba(2,42,27,.10) 0%,rgba(2,42,27,.28) 38%,rgba(2,42,27,.72) 72%,rgba(2,42,27,.94) 100%)}.home-hero-content{position:relative;z-index:2;min-height:calc(100svh - var(--topbar-h));display:flex;align-items:flex-end;justify-content:center;padding:22px 14px 64px}.home-hero-panel{width:100%;max-width:560px;padding:18px;border:1px solid rgba(255,255,255,.18);border-radius:26px;background:linear-gradient(180deg,rgba(0,75,43,.72),rgba(0,48,28,.82));box-shadow:0 20px 60px rgba(0,0,0,.28);backdrop-filter:blur(14px)}.home-hero-panel .hero-logo{font-size:24px;margin-bottom:2px}.home-hero-kicker{display:inline-flex;width:max-content;max-width:100%;padding:6px 10px;border-radius:var(--r-full);background:rgba(212,175,55,.22);border:1px solid rgba(212,175,55,.55);font-size:11px;font-weight:900;color:#fff;margin:8px 0 10px}.home-hero-content h1{font-size:30px;line-height:1.06;letter-spacing:-.8px;margin:0 0 10px;font-weight:950;color:#fff}.home-hero-content p{font-size:14px;color:rgba(255,255,255,.88);line-height:1.45;max-width:520px;margin:0}.home-hero-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:14px 0 0;max-width:none}.home-hero-stats .hero-stat{padding:10px;border-radius:14px;background:rgba(255,255,255,.11)}.home-hero-stats .hero-stat-val{font-size:18px}.home-hero-btn{display:inline-flex!important;align-items:center;justify-content:center;flex:0 0 auto!important;width:auto!important;min-width:0;max-width:100%;margin-top:16px;padding:13px 18px;border-radius:16px;box-shadow:0 10px 24px rgba(212,175,55,.24);line-height:1.1}.home-hero-dots{position:absolute;left:0;right:0;bottom:22px;z-index:4;display:flex;justify-content:center;gap:8px}.home-hero-dot{width:7px;height:7px;border-radius:var(--r-full);border:0;background:rgba(255,255,255,.48);padding:0;transition:width .2s,background .2s}.home-hero-dot.active{width:24px;background:var(--c-gold)}

.news-section{padding:18px 16px}.home-news-section{padding-top:10px}.news-section-title{display:flex;align-items:center;justify-content:space-between}.section-more{font-size:13px;font-weight:800;color:var(--c-green)}.news-grid{display:grid;grid-template-columns:1fr;gap:14px}.news-card{display:block;background:var(--c-surface);border:1px solid var(--c-border);border-radius:var(--r-lg);overflow:hidden;box-shadow:var(--shadow-sm);text-decoration:none;color:inherit;transition:transform .2s,box-shadow .2s}.news-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-md)}.news-card-image{height:180px;background:linear-gradient(135deg,var(--c-green-l),var(--c-gold-l));display:flex;align-items:center;justify-content:center;color:var(--c-green);font-size:42px}.news-card-image img{width:100%;height:100%;object-fit:cover}.news-card-body{padding:14px}.news-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:var(--c-text-3);font-size:12px;font-weight:700;margin-bottom:8px}.news-category{--cat-color:var(--c-green);display:inline-flex;align-items:center;padding:4px 8px;border-radius:var(--r-full);background:var(--c-green-l);color:var(--cat-color);font-size:11px;font-weight:900}.news-card h3{font-size:17px;line-height:1.25;color:var(--c-text);margin:0 0 7px;font-weight:900}.news-card p{font-size:13px;color:var(--c-text-2);line-height:1.45;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.news-card-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px;color:var(--c-text-3);font-size:12px}.news-source{padding:3px 7px;border-radius:var(--r-full);background:var(--c-gold-l);color:var(--c-gold-d);font-weight:800}.news-category-row{display:flex;gap:8px;overflow-x:auto;padding:0 16px 14px}.news-category-chip{white-space:nowrap;padding:9px 12px;border-radius:var(--r-full);background:#fff;border:1px solid var(--c-border);font-weight:800;color:var(--c-text-2);font-size:13px}.news-category-chip.active{background:var(--cat-color,var(--c-green));border-color:var(--cat-color,var(--c-green));color:#fff}.news-category-chip span{opacity:.75;margin-left:4px}.news-page-grid{padding:0 16px 16px}.news-detail{padding:16px}.back-link{display:inline-flex;margin-bottom:12px;font-weight:800}.news-detail-hero{border-radius:var(--r-xl);overflow:hidden;box-shadow:var(--shadow-lg);margin-bottom:14px;background:var(--c-green-l)}.news-detail-hero img{width:100%;max-height:420px;object-fit:cover}.news-detail-body{padding:18px}.news-detail h1{font-size:26px;line-height:1.15;letter-spacing:-.5px;margin:8px 0 10px;color:var(--c-text)}.news-lead{font-size:16px;color:var(--c-text-2);font-weight:650;margin-bottom:16px}.news-content{font-size:16px;line-height:1.75;color:var(--c-text);white-space:normal;overflow-wrap:anywhere}.news-content>*:first-child{margin-top:0}.news-content>*:last-child{margin-bottom:0}.news-content p{margin:0 0 1.1em}.news-content h2,.news-content h3,.news-content h4{line-height:1.25;margin:1.45em 0 .65em;color:var(--c-text);font-weight:900}.news-content h2{font-size:24px}.news-content h3{font-size:21px}.news-content h4{font-size:18px}.news-content blockquote{position:relative;margin:20px 0;padding:16px 18px 16px 22px;border-left:5px solid var(--c-green);border-radius:0 var(--r-md) var(--r-md) 0;background:var(--c-green-l);color:var(--c-text-2);font-weight:700;font-style:italic}.news-content blockquote p{margin:0 0 1em}.news-content blockquote p:last-child{margin-bottom:0}.news-content ul,.news-content ol{margin:0 0 1.1em 1.25em;padding:0}.news-content li{margin:.35em 0}.news-content img{display:block;max-width:100%;height:auto;border-radius:var(--r-md);margin:16px auto}.news-content table{width:100%;border-collapse:collapse;margin:16px 0;display:block;overflow-x:auto}.news-content th,.news-content td{border:1px solid var(--c-border);padding:8px 10px;vertical-align:top}.news-content hr{border:0;border-top:1px solid var(--c-border);margin:22px 0}.news-source-box{margin-top:18px;padding:12px;border-radius:var(--r-md);background:var(--c-surface-2);color:var(--c-text-2)}.news-share{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}.news-share .btn{flex:1;min-width:110px;text-align:center}

.content-admin-list{display:flex;flex-direction:column}.content-admin-item{display:flex;gap:12px;align-items:center;padding:12px;border-bottom:1px solid var(--c-border)}.content-admin-item:last-child{border-bottom:0}.content-admin-item.is-muted{opacity:.58}.content-admin-preview{width:58px;height:58px;border-radius:var(--r-md);background:var(--c-green-l);display:flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0;font-size:24px}.content-admin-preview img{width:100%;height:100%;object-fit:cover}.content-admin-main{min-width:0;flex:1}.content-admin-title{font-size:15px;font-weight:900;color:var(--c-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content-admin-sub{font-size:12px;color:var(--c-text-3);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.content-admin-meta{display:flex;gap:7px;flex-wrap:wrap;margin-top:6px;font-size:11px;color:var(--c-text-3);font-weight:700}.content-admin-actions{display:flex;gap:5px;flex-shrink:0}.content-edit-card{padding:16px}.form-grid-2,.content-upload-grid{display:grid;grid-template-columns:1fr;gap:12px}.content-image-preview{width:100%;height:150px;object-fit:cover;border-radius:var(--r-md);border:1px solid var(--c-border);margin-bottom:8px;background:var(--c-surface-2)}.content-image-preview.is-mobile{height:220px;object-fit:cover}.form-hint{font-size:12px;color:var(--c-text-3);margin-top:4px}.content-filter-card{padding:12px;margin-bottom:14px}

@media (min-width: 720px){.page-wrap{max-width:1100px}.patients-grid{grid-template-columns:repeat(3,1fr)}.news-grid{grid-template-columns:repeat(3,1fr)}.form-grid-2,.content-upload-grid{grid-template-columns:repeat(2,1fr)}.home-hero-slider,.home-hero-content{min-height:620px}.home-hero-content{justify-content:flex-start;align-items:center;padding:90px 36px 74px}.home-hero-panel{max-width:680px;margin-left:0;padding:30px 34px;border-radius:32px}.home-hero-content h1{font-size:52px}.home-hero-content p{font-size:17px}.home-hero-panel .hero-logo{font-size:32px}.home-hero-stats{max-width:360px}.home-hero-btn{padding:15px 24px}.news-detail h1{font-size:38px}.content-admin-preview{width:76px;height:76px}}

/* ================================================================
   NATIVE APP MODE (Android + iOS)
   ================================================================ */
html.native-app-mode,
body.native-app-mode {
  width: 100%;
  min-height: 100%;
  background: #f3f6f5;
  overscroll-behavior-y: none;
}
body.native-app-mode {
  --topbar-h: 62px;
  --tabbar-h: 76px;
  font-size: 15px;
}
body.native-app-mode.has-topbar {
  padding-top: var(--topbar-h);
}
body.native-app-mode.has-tabbar {
  padding-bottom: calc(var(--tabbar-h) + 8px);
}
body.native-app-mode .main-content,
body.native-app-mode #main-content {
  width: 100%;
  max-width: none;
  min-height: calc(100svh - var(--topbar-h));
  padding-bottom: 10px;
}
body.native-app-mode .ehsan-topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  align-items: center;
  padding: 8px 14px;
  background: linear-gradient(135deg, #006b3e 0%, #007f49 100%);
  border-bottom: 0;
  box-shadow: 0 8px 22px rgba(0, 73, 43, .18);
}
body.native-app-mode .topbar-logo {
  font-size: 21px;
  letter-spacing: -.8px;
}
body.native-app-mode .topbar-btn {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: rgba(255,255,255,.14);
}
body.native-app-mode .topbar-btn:active {
  transform: scale(.94);
  background: rgba(255,255,255,.26);
}
body.native-app-mode .ehsan-tabbar {
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: var(--tabbar-h);
  min-height: var(--tabbar-h);
  padding: 8px 8px 10px;
  align-items: center;
  border: 0;
  border-radius: 26px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
}
body.native-app-mode .tab-item {
  height: 58px;
  justify-content: center;
  border-radius: 19px;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
}
body.native-app-mode .tab-item:active {
  background: #eef7f2;
  transform: scale(.96);
}
body.native-app-mode .tab-item.active {
  color: var(--c-green);
  background: #e8f5ee;
}
body.native-app-mode .tab-item .tab-icon {
  font-size: 21px;
}
body.native-app-mode .tab-action-btn,
body.native-app-mode .tab-sos-btn {
  width: 50px;
  height: 50px;
  margin-top: -2px;
  border-width: 3px;
  box-shadow: 0 8px 18px rgba(0,107,62,.24);
}
body.native-app-mode .tab-sos-btn {
  box-shadow: 0 8px 18px rgba(239,68,68,.26);
}
body.native-app-mode .page-wrap {
  max-width: none;
  width: 100%;
}
body.native-app-mode .card,
body.native-app-mode .patient-card,
body.native-app-mode .news-card,
body.native-app-mode .content-filter-card,
body.native-app-mode .modal-box {
  border: 0;
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .07);
}
body.native-app-mode .card,
body.native-app-mode .content-filter-card {
  margin-left: 12px;
  margin-right: 12px;
}
body.native-app-mode .page-header,
body.native-app-mode .section,
body.native-app-mode .filters-wrap,
body.native-app-mode .news-section,
body.native-app-mode .news-page-grid,
body.native-app-mode .news-detail,
body.native-app-mode .patients-grid {
  padding-left: 12px;
  padding-right: 12px;
}
body.native-app-mode .btn,
body.native-app-mode button,
body.native-app-mode .form-control,
body.native-app-mode input,
body.native-app-mode select,
body.native-app-mode textarea {
  border-radius: 16px;
}
body.native-app-mode .btn,
body.native-app-mode button[type="submit"] {
  min-height: 46px;
  font-weight: 850;
}
body.native-app-mode a,
body.native-app-mode button,
body.native-app-mode .card,
body.native-app-mode .patient-card,
body.native-app-mode .news-card {
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease;
}
body.native-app-mode .patient-card:active,
body.native-app-mode .news-card:active,
body.native-app-mode .card:active {
  transform: scale(.985);
}
body.native-app-mode .ehsan-drawer {
  width: min(340px, 88vw);
  border-radius: 0 28px 28px 0;
}
body.native-app-mode .drawer-header {
  padding-top: 24px;
  border-radius: 0 0 24px 0;
}
body.native-app-mode .toast-container {
  bottom: calc(var(--tabbar-h) + 22px);
}
body.native-app-mode .home-hero-slider,
body.native-app-mode .home-hero-content {
  min-height: calc(100svh - var(--topbar-h));
}
body.native-app-mode .home-hero-content {
  padding: 18px 12px calc(var(--tabbar-h) + 28px);
}
body.native-app-mode .home-hero-panel {
  border-radius: 28px;
  max-width: none;
}
body.native-app-mode .home-hero-content h1 {
  font-size: clamp(26px, 8vw, 38px);
}
body.native-app-mode .pc-photo,
body.native-app-mode .pc-photo-ph,
body.native-app-mode .news-card-image {
  height: 210px;
}
@media (min-width: 720px) {
  body.native-app-mode .page-wrap,
  body.native-app-mode .home-hero-panel {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
  body.native-app-mode .patients-grid,
  body.native-app-mode .news-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
}
body.ios-app-mode {
  --topbar-h: calc(58px + env(safe-area-inset-top));
  --tabbar-h: calc(74px + env(safe-area-inset-bottom));
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
body.ios-app-mode .ehsan-topbar {
  padding-top: calc(8px + env(safe-area-inset-top));
}
body.ios-app-mode .ehsan-tabbar {
  bottom: max(8px, env(safe-area-inset-bottom));
}
body.ios-app-mode input,
body.ios-app-mode textarea,
body.ios-app-mode select {
  -webkit-user-select: text;
}
body.ios-app-mode .toast-container {
  bottom: calc(var(--tabbar-h) + 20px);
}

/* ── Shared Yandex map user markers & clusters ─────────────────── */
.ehsan-map-marker-shell {
  position: relative;
  display: block;
  animation: ehsanMapMarkerIn .18s ease-out both;
}
.ehsan-map-avatar-marker {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--c-green);
  background: #f3f4f6;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .28);
  box-sizing: border-box;
}
.ehsan-map-avatar-marker.is-offline {
  border-color: #9ca3af;
  opacity: .78;
}
.ehsan-map-avatar-marker.has-box {
  border-color: #2563eb;
}
.ehsan-map-avatar-marker.is-current {
  border-color: var(--c-red);
}
.ehsan-map-cluster {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--c-green);
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .28);
  overflow: hidden;
  box-sizing: border-box;
}
.ehsan-map-cluster.is-offline {
  border-color: #9ca3af;
  opacity: .9;
}
.ehsan-map-cluster.has-box {
  border-color: #2563eb;
}
.ehsan-map-cluster-avatars {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--c-green);
}
.ehsan-map-cluster-avatar {
  position: absolute;
  width: 52%;
  height: 52%;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .2);
  animation: ehsanClusterFloat 2.4s ease-in-out infinite;
}
.ehsan-map-cluster-avatar.avatar-0 { left: 6%; top: 8%; animation-delay: 0s; }
.ehsan-map-cluster-avatar.avatar-1 { right: 6%; top: 10%; animation-delay: .2s; }
.ehsan-map-cluster-avatar.avatar-2 { left: 10%; bottom: 6%; animation-delay: .35s; }
.ehsan-map-cluster-avatar.avatar-3 { right: 8%; bottom: 6%; animation-delay: .5s; }
.ehsan-map-cluster-count {
  position: absolute;
  right: -1px;
  bottom: -1px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--c-green);
  color: #fff;
  border: 2px solid #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 1px 5px rgba(15, 23, 42, .2);
}
.ehsan-map-user-list {
  min-width: 240px;
  max-width: min(340px, 82vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ehsan-map-user-list.is-balloon {
  min-width: 220px;
}
.ehsan-map-user-list-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--c-text);
  margin-bottom: 4px;
}
.ehsan-map-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  background: #fff;
}
.ehsan-map-user-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--c-green);
}
.ehsan-map-user-main {
  min-width: 0;
  flex: 1;
}
.ehsan-map-user-name {
  font-size: 13px;
  font-weight: 850;
  color: var(--c-text);
  line-height: 1.25;
}
.ehsan-map-user-meta {
  font-size: 11px;
  color: var(--c-text-3);
  line-height: 1.35;
  margin-top: 1px;
}
.ehsan-map-user-open,
.ehsan-map-user-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 900;
}
.ehsan-map-user-open {
  width: 28px;
  height: 28px;
  color: #fff;
  background: var(--c-green);
  font-size: 20px;
}
.ehsan-map-user-action {
  min-height: 36px;
  color: #fff;
  background: var(--c-green);
  font-size: 13px;
  margin-top: 2px;
}
@keyframes ehsanMapMarkerIn {
  from { opacity: 0; filter: blur(2px); }
  to { opacity: 1; filter: blur(0); }
}
@keyframes ehsanClusterFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(1px, -1px); }
}
