/* ===================================================
   Дени Спорт — глобален стил
   Тъмен (default) + светъл режим, mobile-first
   =================================================== */

:root {
  --bg:           #0a0a0a;
  --bg-elev:      #0f0f0f;
  --surface:      #171717;
  --surface-2:    #1f1f1f;
  --text:         #f5f5f5;
  --text-muted:   #a3a3a3;
  --border:       #262626;
  --accent:       #e7ff00;
  --accent-dark:  #c5d800;
  --danger:       #ff4d4d;
  --success:      #4ade80;
  --shadow:       0 20px 60px rgba(0,0,0,0.4);
  --header-h:     60px;
  --nav-row-h:    44px;
  --header-total: 104px;
  --radius:       12px;
  --radius-lg:    20px;
  --font-display: 'Bebas Neue', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  /* Спира callout-а при long-press (iOS „Save image", „Copy") */
  -webkit-touch-callout: none;
  /* Спира blue/gray flash при tap */
  -webkit-tap-highlight-color: transparent;
}

/* Touch action: блокира double-tap zoom + браузърни жестове на всичко с изключение на скролваеми зони */
html, body, button, a, .modal-dialog, .admin-modal-inner, .loc-help-dialog {
  touch-action: manipulation;
}

html {
  /* Dark fallback зад всичко — heroBg fixed e на нивото на body, html bg-то е под него */
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Спира pull-to-refresh и horizontal swipe back */
  overscroll-behavior: contain;
}

body {
  margin: 0;
  font-family: var(--font-body);
  /* TRANSPARENT — за да се вижда fixed heroBg-то зад целия content.
     Fallback за дъното идва от html { background } по-горе. */
  background: transparent;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s, color 0.25s;
  /* Блокира селекция на текст НАВСЯКЪДЕ (освен изрично разрешено по-долу) */
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: contain;
}

/* Разрешаваме селекция/callout САМО в input/textarea/[contenteditable] */
input, textarea, [contenteditable="true"], .selectable {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* iOS auto-zoom prevention: input font-size трябва да е >=16px на mobile,
   иначе Safari автоматично zoom-ва при focus. */
input, textarea, select {
  font-size: 16px;  /* минимум за iOS */
}
@media (min-width: 768px) {
  /* На desktop може да са по-малки */
  input, textarea, select { font-size: 1rem; }
}

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

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============== HEADER ============== */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-h);
  gap: 16px;
}
.header-left  { justify-self: start;  display: flex; align-items: center; }
.header-right { justify-self: end;    display: flex; align-items: center; gap: 10px; }

.brand {
  justify-self: center;
  display: flex; align-items: center;
}
.brand .logo {
  height: 44px;
  width: auto;
  display: block;
}

/* Nav row под header-а */
.nav-row {
  border-top: 1px solid var(--border);
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  height: var(--nav-row-h);
}
.nav-row-inner {
  display: flex; justify-content: center;
  gap: 32px;
  height: 100%;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-row-inner::-webkit-scrollbar { display: none; }
.nav-row a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 0;
  position: relative;
  transition: color 0.15s;
  letter-spacing: 0.02em;
}
.nav-row a:hover { color: var(--text); }
.nav-row a::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px; background: var(--accent);
  transition: width 0.2s;
}
.nav-row a:hover::after { width: 100%; }

/* Quick OPEN бутон (header — ляво) */
.btn-quick-open {
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  padding: 9px 14px;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-quick-open:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(231,255,0,0.3);
}
.btn-quick-open:disabled { opacity: 0.85; cursor: wait; }
.btn-quick-open.opening {
  animation: pulse-glow 1s ease-in-out infinite;
}
.btn-quick-open .quick-icon  { font-size: 1rem; line-height: 1; }
.btn-quick-open .quick-icon-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.btn-quick-open .quick-label { white-space: nowrap; }

/* Profile бутон (header — дясно) */
.profile-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}
.profile-btn:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}
.profile-btn.logged-in {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}
.profile-btn .profile-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 100%; height: 100%;
  line-height: 1;
}

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: all 0.15s ease;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(231,255,0,0.25);
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--text); background: var(--surface); }

.btn-link {
  background: transparent;
  color: var(--text-muted);
  text-transform: none;
  font-weight: 500;
  padding: 8px;
}
.btn-link:hover { color: var(--text); }

.btn-open {
  /* CSS variables за цветовете — overridable от .status-* класовете */
  --btn-color:  #ff013c;  /* основен (диагонал) */
  --btn-accent: #00e6f6;  /* offset shadow + overlay accent */
  --btn-glitch: #f8f005;  /* text-shadow за glitch ефекта */
  --btn-text:   #fff;

  position: relative;
  width: 100%;
  padding: 22px 24px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.12em;
  color: var(--btn-text);
  background: linear-gradient(45deg, transparent 5%, var(--btn-color) 5%);
  border: 0;
  border-radius: 0;
  box-shadow: 6px 0px 0px var(--btn-accent);
  outline: transparent;
  text-transform: none;
  cursor: pointer;
  overflow: visible;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: background-color 0.3s, box-shadow 0.3s;
}
.btn-open:disabled { cursor: wait; opacity: 0.95; }

.btn-open .btn-open-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  filter: drop-shadow(2px 0 0 #00e6f6) drop-shadow(-1px 1px 0 #f8f005);
}
.btn-open .btn-label {
  position: relative;
  z-index: 2;
  line-height: 1;
}

.btn-open::after {
  --slice-0: inset(50% 50% 50% 50%);
  --slice-1: inset(80% -6px 0 0);
  --slice-2: inset(50% -6px 30% 0);
  --slice-3: inset(10% -6px 85% 0);
  --slice-4: inset(40% -6px 43% 0);
  --slice-5: inset(80% -6px 5% 0);
  content: attr(data-text);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(45deg, transparent 3%, var(--btn-accent) 3%, var(--btn-accent) 5%, var(--btn-color) 5%);
  text-shadow: -3px -3px 0px var(--btn-glitch), 3px 3px 0px var(--btn-accent);
  clip-path: var(--slice-0);
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.12em;
  color: var(--btn-text);
  pointer-events: none;
  z-index: 1;
  animation: openGlitch 1s steps(2, end) infinite;
}

.btn-open.opening::after {
  animation-play-state: paused;
}

@keyframes openGlitch {
  0%   { clip-path: var(--slice-1); transform: translate(-20px, -10px); }
  10%  { clip-path: var(--slice-3); transform: translate(10px, 10px); }
  20%  { clip-path: var(--slice-1); transform: translate(-10px, 10px); }
  30%  { clip-path: var(--slice-3); transform: translate(0px, 5px); }
  40%  { clip-path: var(--slice-2); transform: translate(-5px, 0px); }
  50%  { clip-path: var(--slice-3); transform: translate(5px, 0px); }
  60%  { clip-path: var(--slice-4); transform: translate(5px, 10px); }
  70%  { clip-path: var(--slice-2); transform: translate(-10px, 10px); }
  80%  { clip-path: var(--slice-5); transform: translate(20px, -10px); }
  90%  { clip-path: var(--slice-1); transform: translate(-10px, 0px); }
  100% { clip-path: var(--slice-1); transform: translate(0); }
}

/* Pulse glow остава за quick header бутона */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,255,0,0.7); }
  50%      { box-shadow: 0 0 0 20px rgba(231,255,0,0); }
}

/* ============== STATUS COLOR VARIANTS ============== */
/* Без лимит — brand жълто (текст тъмен) */
.btn-open.status-unlimited {
  --btn-color:  #e7ff00;
  --btn-accent: #0a0a0a;
  --btn-glitch: #00e6f6;
  --btn-text:   #0a0a0a;
}
/* 15+ дни — зелено */
.btn-open.status-good {
  --btn-color:  #16a34a;
  --btn-accent: #fbbf24;
  --btn-glitch: #ffffff;
  --btn-text:   #fff;
}
/* 8-14 дни — лайм-зелено (warming) */
.btn-open.status-soon {
  --btn-color:  #84cc16;
  --btn-accent: #00e6f6;
  --btn-glitch: #fff;
  --btn-text:   #0a0a0a;
}
/* 4-7 дни — оранжево */
.btn-open.status-warning {
  --btn-color:  #f97316;
  --btn-accent: #00e6f6;
  --btn-glitch: #fff;
  --btn-text:   #fff;
}
/* 1-3 дни — ярко червено (current default) */
.btn-open.status-danger {
  --btn-color:  #ff013c;
  --btn-accent: #00e6f6;
  --btn-glitch: #f8f005;
  --btn-text:   #fff;
}
/* 0 дни (днес!) — критично тъмно червено */
.btn-open.status-critical {
  --btn-color:  #991b1b;
  --btn-accent: #ff0000;
  --btn-glitch: #fff;
  --btn-text:   #fff;
}

/* ============== NAV BAR — chromatic aberration glitch ============== */
/* По-малки бутони → no clip-path shifts (за да не подскачат в header-а).
   Силна chromatic aberration в text-shadow + по-чести бурстове на всеки 3 сек. */

.btn-quick-open .quick-label {
  position: relative;
  z-index: 2;
  animation: navGlitchText 3s steps(1, end) infinite;
}
.btn-quick-open .quick-icon-svg {
  position: relative;
  z-index: 2;
  filter: drop-shadow(2px 0 0 #00e6f6) drop-shadow(-2px 0 0 #ff013c);
  animation: navGlitchSvg 3s steps(1, end) infinite;
}

@keyframes navGlitchText {
  0%, 78%, 100% {
    text-shadow: 2px 0 0 #00e6f6, -2px 0 0 #ff013c;
    transform: translate(0, 0);
  }
  79% {
    text-shadow: 3px 0 0 #00e6f6, -3px 0 0 #ff013c, 0 0 6px #f8f005;
    transform: translate(-2px, 0);
  }
  80% {
    text-shadow: -4px -2px 0 #00e6f6, 4px 2px 0 #ff013c;
    transform: translate(2px, -1px);
  }
  82% {
    text-shadow: 3px 0 0 #00e6f6, -3px 0 0 #ff013c, 0 0 4px #ff013c;
    transform: translate(-2px, 2px);
  }
  84% {
    text-shadow: 4px 2px 0 #00e6f6, -4px -2px 0 #ff013c;
    transform: translate(1px, 0);
  }
  86%, 88% {
    text-shadow: 5px 0 0 #00e6f6, -5px 0 0 #ff013c, 0 0 8px #ff013c;
    transform: translate(0, 0);
  }
}

@keyframes navGlitchSvg {
  0%, 78%, 100% {
    filter: drop-shadow(2px 0 0 #00e6f6) drop-shadow(-2px 0 0 #ff013c);
    transform: translate(0, 0);
  }
  79% {
    filter: drop-shadow(3px 0 0 #00e6f6) drop-shadow(-3px 0 0 #ff013c) drop-shadow(0 0 4px #f8f005);
    transform: translate(-2px, 0);
  }
  80% {
    filter: drop-shadow(-4px -2px 0 #00e6f6) drop-shadow(4px 2px 0 #ff013c);
    transform: translate(2px, -1px);
  }
  82% {
    filter: drop-shadow(3px 0 0 #00e6f6) drop-shadow(-3px 0 0 #ff013c);
    transform: translate(-2px, 2px);
  }
  84% {
    filter: drop-shadow(4px 2px 0 #00e6f6) drop-shadow(-4px -2px 0 #ff013c);
    transform: translate(1px, 0);
  }
  86%, 88% {
    filter: drop-shadow(5px 0 0 #00e6f6) drop-shadow(-5px 0 0 #ff013c);
    transform: translate(0, 0);
  }
}

/* Glitch и за profile icon (буквата/👤 в кръга) — БЕЗ override на display:flex centering */
.profile-btn .profile-icon {
  animation: navGlitchText 3s steps(1, end) infinite;
  animation-delay: 1.5s;  /* offset за да не са синхронни с quick бутона */
  /* ВАЖНО: НЕ override-ваме display/align-items/justify-content от base правилото
     иначе буквата не е центрирана в кръга. */
}
.profile-btn.logged-in .profile-icon {
  text-shadow: 2px 0 0 #00e6f6, -2px 0 0 #ff013c;
}

/* ============== Quick header бутон — statusи ============== */
.btn-quick-open.status-unlimited {
  background: var(--accent);
  color: #0a0a0a;
}
.btn-quick-open.status-good {
  background: #16a34a;
  color: #fff;
}
.btn-quick-open.status-soon {
  background: #84cc16;
  color: #0a0a0a;
}
.btn-quick-open.status-warning {
  background: #f97316;
  color: #fff;
}
.btn-quick-open.status-danger {
  background: #ff013c;
  color: #fff;
}
.btn-quick-open.status-critical {
  background: #991b1b;
  color: #fff;
  animation: criticalPulse 1.2s ease-in-out infinite;
}
@keyframes criticalPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  50%      { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
}
.btn-quick-open.status-unlimited:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(231,255,0,0.3);
}
.btn-quick-open.status-good:hover:not(:disabled) { box-shadow: 0 6px 16px rgba(22,163,74,0.4); }
.btn-quick-open.status-soon:hover:not(:disabled) { box-shadow: 0 6px 16px rgba(132,204,22,0.4); }
.btn-quick-open.status-warning:hover:not(:disabled) { box-shadow: 0 6px 16px rgba(249,115,22,0.4); }
.btn-quick-open.status-danger:hover:not(:disabled) { box-shadow: 0 6px 16px rgba(255,1,60,0.4); }

/* Мобилно — малко по-малък glitch бутон */
@media (max-width: 480px) {
  .btn-open { font-size: 1.4rem; padding: 18px 18px; }
  .btn-open::after { font-size: 1.4rem; }
  .btn-open .btn-open-icon { width: 24px; height: 24px; }
}

/* ============== HERO ============== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: var(--header-total) 0 80px;
  /* НЕ overflow:hidden — heroBg е position:fixed и трябва да се вижда зад всички секции.
     Background е transparent (image идва от .hero-bg който е fixed под content-а). */
  background: transparent;
}
.hero-bg {
  /* TRUE fixed bg — image остава визуално фиксиран в viewport-а независимо от scroll.
     Position: fixed escape-ва hero overflow → image е видим зад ВСИЧКИ секции
     (които са semi-transparent с backdrop-filter blur). */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* z-index: 0 (вместо -1) → за да е видим над body bg.
     Body вече е transparent → html bg-то е fallback дъно. */
  z-index: 0;
  pointer-events: none;
}
.hero-bg.default {
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(231,255,0,0.08), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(231,255,0,0.05), transparent 50%),
    linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2), rgba(0,0,0,0.7));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}
.hero-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 8rem);
  line-height: 0.9;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
  font-weight: 400;
  background: linear-gradient(180deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-tagline {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 10px;
}
.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 36px;
}
.hero-cta {
  display: flex; gap: 14px;
  justify-content: center; flex-wrap: wrap;
}

.hero-scroll {
  position: absolute; left: 50%; bottom: 30px;
  transform: translateX(-50%);
  z-index: 2;
  width: 24px; height: 40px;
  border: 2px solid var(--text-muted);
  border-radius: 12px;
  opacity: 0.6;
}
.hero-scroll span {
  display: block;
  width: 3px; height: 8px;
  background: var(--text-muted);
  border-radius: 2px;
  margin: 6px auto;
  animation: scroll-down 1.6s ease-in-out infinite;
}
@keyframes scroll-down {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* ============== SECTIONS ============== */
.section {
  padding: 100px 0;
  /* Semi-transparent overlay над fixed hero bg — гарантира четимост на текста */
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  position: relative;
  z-index: 1;  /* над heroBg (z-index: 0) */
}
.section-alt {
  background: rgba(15, 15, 15, 0.82);
}
.section-head {
  text-align: center;
  margin-bottom: 56px;
}
.section-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  letter-spacing: 0.04em;
  margin: 0 0 14px;
  font-weight: 400;
  line-height: 1;
}
.section-sub {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1rem;
}

/* ============== SCHEDULE ============== */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.schedule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  transition: all 0.2s;
}
.schedule-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.schedule-day {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.schedule-hours {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ============== ABOUT ============== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: center;
}
.about-text .section-title { text-align: left; }
.about-body {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  white-space: pre-line;
}
.about-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex; align-items: baseline; gap: 16px;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ============== GALLERY ============== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-caption {
  position: absolute; inset: auto 0 0 0;
  padding: 16px;
  background: linear-gradient(0deg, rgba(0,0,0,0.8), transparent);
  font-size: 0.92rem;
  font-weight: 600;
  color: white;
  opacity: 0; transition: opacity 0.2s;
}
.gallery-item:hover .gallery-caption { opacity: 1; }
.gallery-empty {
  text-align: center; color: var(--text-muted); padding: 40px;
}

/* ============== CONTACT ============== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
  align-items: start;
}
.contact-info .section-title { text-align: left; }
.contact-list {
  list-style: none; padding: 0; margin: 30px 0;
  display: flex; flex-direction: column; gap: 18px;
}
.contact-list li, .contact-list a {
  display: flex; align-items: flex-start; gap: 14px;
  color: var(--text);
  transition: color 0.15s;
}
.contact-list a:hover { color: var(--accent); }
.contact-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.contact-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.social {
  display: flex; gap: 10px; margin-top: 24px;
}
.social a {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 1.1rem;
  transition: all 0.15s;
}
.social a:hover {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
  transform: translateY(-2px);
}
.contact-map {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.contact-map iframe { width: 100%; height: 100%; border: 0; display: block; }
.contact-map-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
  color: var(--text-muted);
}

/* ============== FOOTER ============== */
.footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  position: relative;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.footer-brand {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  font-size: 1.1rem;
}
.footer-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============== MODAL ============== */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  /* На iOS визуалният viewport се мени с клавиатурата — позиционираме спрямо него */
  height: 100vh;
  height: 100dvh;  /* dynamic viewport height — реагира на клавиатурата */
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.2s;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-dialog {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  width: 100%; max-width: 440px;
  /* --vvh се update-ва от JS чрез window.visualViewport (за iOS с клавиатура) */
  /* Fallbacks: dvh за модерни browser-и, vh за стари */
  max-height: 90vh;
  max-height: 90dvh;
  max-height: calc(var(--vvh, 100vh) - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow);
  animation: slide-up 0.25s ease;
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-tabs {
  display: flex; gap: 4px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}
.modal-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.15s;
}
.modal-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.04em;
  margin: 0 0 18px;
  font-weight: 400;
}

.modal-form {
  display: flex; flex-direction: column; gap: 14px;
}
.modal-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.85rem; color: var(--text-muted);
  font-weight: 500;
}
.modal-form input {
  width: 100%;
  padding: 14px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px; /* предотвратява зум на iOS */
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  scroll-margin-top: 100px;
  scroll-margin-bottom: 100px;
}
.modal-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(231,255,0,0.15);
}
.modal-form button[type=submit] { margin-top: 6px; }

.form-msg { display: none; padding: 10px 12px; border-radius: 8px; font-size: 0.88rem; }
.form-msg.show { display: block; }
.form-msg.error { background: rgba(255,77,77,0.1); color: var(--danger); border: 1px solid rgba(255,77,77,0.25); }
.form-msg.ok    { background: rgba(74,222,128,0.1); color: var(--success); border: 1px solid rgba(74,222,128,0.25); }

/* OPEN pane (door control) */
.modal-pane[data-pane="open"] {
  display: flex; flex-direction: column; gap: 18px;
}
.open-greeting {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  row-gap: 4px;
}

/* Profile avatar — голяма кръгла снимка (или буква) до welcome message */
.profile-avatar {
  position: relative;
  flex-basis: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.profile-avatar::after {
  /* Кръгла рамка-стенд за avatar-а */
  content: '';
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--accent);
  z-index: 0;
}
.profile-avatar-img,
.profile-avatar-letter {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
}
.profile-avatar-img {
  object-fit: cover;
  display: block;
}
.profile-avatar-img[hidden] { display: none !important; }
.profile-avatar-letter {
  background: var(--accent);
  color: #0a0a0a;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}
.profile-avatar-letter[hidden] { display: none !important; }
.open-hello {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-basis: 100%;
  text-align: center;
}
.open-name {
  font-family: var(--font-display);
  font-size: 2rem; margin: 0;
  letter-spacing: 0.04em; font-weight: 400;
}

/* Streak chip — малък огнен pill до името */
.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,107,53,0.2) 0%, rgba(255,1,60,0.2) 100%);
  border: 1px solid rgba(255,107,53,0.45);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  animation: streakChipPulse 2.5s ease-in-out infinite;
  line-height: 1;
}
.streak-chip[hidden] { display: none !important; }
.streak-chip-icon { font-size: 0.95rem; line-height: 1; }
@keyframes streakChipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,53,0); }
  50%      { box-shadow: 0 0 14px rgba(255,107,53,0.6); }
}
.occupancy-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(231, 255, 0, 0.08), rgba(231, 255, 0, 0.02));
  border: 1px solid rgba(231, 255, 0, 0.22);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}
.occupancy-card[hidden] { display: none !important; }
.occupancy-card.is-empty {
  background: var(--surface-2);
  border-color: var(--border);
}
.occupancy-dot {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(231, 255, 0, 0.6);
}
.occupancy-card.is-empty .occupancy-dot {
  background: var(--text-muted);
  box-shadow: none;
}
.occupancy-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: occupancy-pulse 2.2s ease-out infinite;
}
.occupancy-card.is-empty .occupancy-pulse { display: none; }
@keyframes occupancy-pulse {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}
.occupancy-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.occupancy-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.occupancy-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.occupancy-count {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.occupancy-suffix {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.occupancy-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  align-self: flex-start;
  margin-top: 2px;
  white-space: nowrap;
}

.open-info {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.open-info-row {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  font-size: 0.92rem;
}
.open-info-row span { color: var(--text-muted); }
.open-info-row b { color: var(--text); }
.open-info-row b.warn { color: #ffb020; }
.open-info-row b.danger { color: var(--danger); }

.expire-banner {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  line-height: 1.35;
}
.expire-banner.warn {
  background: rgba(255, 176, 32, 0.12);
  color: #ffb020;
  border: 1px solid rgba(255, 176, 32, 0.3);
}
.expire-banner.danger {
  background: rgba(255, 77, 77, 0.12);
  color: var(--danger);
  border: 1px solid rgba(255, 77, 77, 0.3);
  animation: pulse-warn 2s ease-in-out infinite;
}
@keyframes pulse-warn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,77,77,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(255,77,77,0); }
}
.expire-banner-icon {
  font-size: 1.2rem; flex-shrink: 0;
}

/* ============== RESPONSIVE ============== */
@media (max-width: 900px) {
  .about-grid    { grid-template-columns: 1fr; gap: 40px; }
  .contact-grid  { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 768px) {
  /* Hero на мобилно: снимката е зад текста, лек breathing room отгоре и без излишна празнина отдолу */
  .hero {
    align-items: flex-start;
    min-height: auto;  /* hero расте по съдържанието, без 100vh празно пространство */
    padding: calc(var(--header-total) + 14px) 0 32px;
    background: linear-gradient(180deg, #0a0a0a 0%, #141414 100%);
  }
  .hero-bg {
    top: calc(var(--header-total) + 14px);  /* лек padding между nav-а и снимката */
  }
  .hero-bg:not(.default) {
    background-size: contain;
    background-position: center top;
    background-repeat: no-repeat;
  }
  .hero-overlay {
    top: calc(var(--header-total) + 14px);
  }

  .section { padding: 70px 0; }
  .section-head { margin-bottom: 36px; }

  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }

  .schedule-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid  { grid-template-columns: repeat(2, 1fr); }

  .footer-inner { flex-direction: column; text-align: center; }

  .modal { padding: 0; align-items: flex-end; }
  .modal-dialog {
    max-width: 100%;
    max-height: 95vh;
    max-height: 95dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    animation: slide-up-mobile 0.25s ease;
  }
  @keyframes slide-up-mobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  /* Когато клавиатурата е отворена — позволяваме повече place за input */
  .modal-form label { font-size: 0.82rem; }
  .modal-tabs { margin-bottom: 18px; }
}

@media (max-width: 420px) {
  .container { padding: 0 16px; }
  .schedule-grid { grid-template-columns: 1fr; }
  .gallery-grid  { grid-template-columns: 1fr; }
  .btn-open { padding: 24px; font-size: 1.3rem; }

  /* Header — по-компактен на малки телефони */
  .header-grid { gap: 8px; }
  .brand .logo { height: 36px; }
  .profile-btn { width: 36px; height: 36px; font-size: 0.95rem; }
  /* Quick OPEN — само икона на мобилно */
  .btn-quick-open { padding: 0; width: 38px; height: 38px; justify-content: center; }
  .btn-quick-open .quick-label { display: none; }
  .btn-quick-open .quick-icon { font-size: 1.15rem; }
  /* Nav row — по-компактен */
  .nav-row-inner { gap: 20px; font-size: 0.82rem; padding: 0 12px; }

  /* Hero — по-малък текст за да се събере всичко */
  .hero { padding: var(--header-total) 0 40px; }
  .hero-eyebrow { font-size: 0.68rem; letter-spacing: 0.2em; }
  .hero-subtitle { margin-bottom: 24px; }

  /* Modal — съдържанието не може да е под header-а */
  .modal-dialog { padding: 22px 18px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .modal-title { font-size: 1.5rem; }

  /* Admin modal — header по-компактен */
  .admin-header { padding: 12px 14px; }
  .admin-title { font-size: 1.2rem; }
  .admin-back, .admin-refresh { width: 36px; height: 36px; font-size: 1.15rem; }
}

/* ============== ADMIN MODAL ============== */
.admin-modal {
  position: fixed; inset: 0;
  z-index: 110;
  background: var(--bg);
  display: flex; flex-direction: column;
  animation: fade-in 0.2s ease;
  /* iOS safe area — top за notch, bottom за home indicator */
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.admin-modal[hidden] { display: none; }
.admin-modal-inner {
  display: flex; flex-direction: column;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}
.admin-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  position: sticky; top: 0; z-index: 5;
}
.admin-back, .admin-refresh {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 1.3rem;
  color: var(--text);
  transition: background 0.15s;
}
.admin-back:hover, .admin-refresh:hover { background: var(--surface); }
.admin-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  margin: 0;
  font-weight: 400;
}

.admin-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  /* Скрий горизонтален scrollbar на mobile (но запази scroll функционалността) */
  scroll-snap-type: x proximity;
}
.admin-tabs::-webkit-scrollbar { height: 3px; }
.admin-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.admin-tab {
  padding: 14px 14px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  flex: 0 0 auto;
  scroll-snap-align: start;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  cursor: pointer;
}
.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
/* Color-coded подсветки за всеки таб (subtle, само на active) */
.admin-tab.active[data-admintab="users"]    { color: var(--accent);   border-bottom-color: var(--accent); }
.admin-tab.active[data-admintab="chat"]     { color: #4fc3f7;          border-bottom-color: #4fc3f7; }
.admin-tab.active[data-admintab="security"] { color: var(--danger);    border-bottom-color: var(--danger); }
.admin-tab.active[data-admintab="logs"]     { color: #a3a3a3;          border-bottom-color: #a3a3a3; }
.admin-tab.active[data-admintab="push"]     { color: var(--success);   border-bottom-color: var(--success); }
.admin-tab:hover:not(.active) { color: var(--text); }

/* На mobile — по-компактен padding за да хапе място */
@media (max-width: 600px) {
  .admin-tabs { padding: 0 8px; gap: 2px; }
  .admin-tab { padding: 12px 10px; font-size: 0.85rem; }
}

.admin-pane {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 60px;
}
.admin-pane[hidden] { display: none; }

/* ============== ADMIN TOOLBAR (search + filters) ============== */
.admin-toolbar {
  position: sticky; top: 0;
  background: var(--bg);
  padding: 12px 0 14px;
  margin: -12px 0 12px;
  z-index: 5;
  display: flex; flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 12px -8px var(--bg);
}
.admin-toolbar input[type="search"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.admin-toolbar input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(231,255,0,0.15);
}

/* ============== FILTER CHIPS ============== */
.admin-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-width: thin;
  margin: 0 -4px;
  padding-left: 4px;
  padding-right: 4px;
}
.admin-filters::-webkit-scrollbar { height: 4px; }
.admin-filters::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.filter-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.filter-chip:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
.filter-chip.active {
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
}
.chip-count {
  background: rgba(0,0,0,0.18);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  min-width: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.filter-chip:not(.active) .chip-count {
  background: var(--surface-2);
  color: var(--text-muted);
}

.admin-list {
  display: flex; flex-direction: column; gap: 10px;
}
.admin-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 0.95rem;
}

/* ============== USER CARD ============== */
.user-card {
  display: flex; align-items: stretch; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px 14px 14px;
  transition: border-color 0.15s;
}
.user-card:hover { border-color: var(--text-muted); }

/* Малък thumbnail в admin user-card */
.user-card-thumb {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  align-self: flex-start;
  margin-top: 2px;
}
.user-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.user-card-thumb-letter {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 700;
  font-size: 1rem;
  font-family: var(--font-display);
}
.user-card-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.user-card-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 2px;
}
.user-card-name {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-card-email {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-card-meta {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.user-card-meta span:first-child { color: var(--text); font-weight: 600; }
.user-card-phone {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 0 2px;
  margin-top: 4px;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.user-card-phone:hover { text-decoration: underline; }
.user-card-phone:active { opacity: 0.7; }

.user-card-action {
  width: 40px;
  font-size: 1.5rem;
  color: var(--text-muted);
  border-radius: 10px;
  transition: all 0.15s;
  flex-shrink: 0;
  align-self: center;
}
.user-card-action:hover { background: var(--surface-2); color: var(--text); }

.admin-mark { font-size: 0.95rem; }

.exempt-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.4);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ============== STATUS BADGES ============== */
.status-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.status-active  { background: rgba(74,222,128,0.15);  color: var(--success); }
.status-pending { background: rgba(255,176,32,0.15);  color: #ffb020; }
.status-blocked { background: rgba(255,77,77,0.15);   color: var(--danger); }
.status-expired { background: rgba(163,163,163,0.18); color: var(--text-muted); }

/* ============== ACTION MENU ============== */
.action-menu {
  position: fixed; inset: 0;
  z-index: 120;
  display: flex; align-items: flex-end; justify-content: center;
}
.action-menu[hidden] { display: none; }
.action-menu-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 0.15s;
}
.action-menu-content {
  position: relative;
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  margin: 0 16px;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
  animation: slide-up-mobile 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.action-menu-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 8px 14px 12px;
  text-align: center;
  word-break: break-all;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.action-menu-item {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text);
  border-radius: 10px;
  transition: background 0.15s;
}
.action-menu-item:hover:not(.cancel) { background: var(--surface-2); }
.action-menu-item.danger { color: var(--danger); }
.action-menu-item.cancel {
  text-align: center;
  color: var(--text-muted);
  margin-top: 6px;
  border: 1px solid var(--border);
}
.action-menu-item.cancel:hover { background: var(--surface-2); color: var(--text); }
.action-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

@media (min-width: 600px) {
  .action-menu { align-items: center; }
  .action-menu-content {
    border-radius: var(--radius-lg);
    margin: 0 20px;
    animation: slide-up 0.2s ease;
  }
}

/* ============== ADMIN LOGS ============== */
.log-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
}
.log-when {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.log-who {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.log-act {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.log-act.ok  { background: rgba(74,222,128,0.15); color: var(--success); }
.log-act.err { background: rgba(255,77,77,0.15);  color: var(--danger); }

@media (max-width: 480px) {
  .admin-tabs { padding: 0 8px; }
  .admin-pane { padding: 12px 14px 60px; }
  .log-row {
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 12px 14px;
  }
  .log-when {
    grid-column: 1 / -1;
    font-size: 0.78rem;
    order: -1;
  }
  .log-who {
    font-size: 0.95rem;
  }
  /* User cards — по-компактни на мобилно */
  .user-card { padding: 12px 8px 12px 14px; }
  .user-card-name { font-size: 0.95rem; }
  .user-card-email { font-size: 0.78rem; }
  .user-card-meta { font-size: 0.78rem; gap: 8px; }
  .user-card-action { width: 36px; font-size: 1.3rem; }

  /* Filter chips — мъничко по-компактни */
  .filter-chip { padding: 7px 12px; font-size: 0.8rem; }
  .chip-count { padding: 2px 7px; font-size: 0.68rem; min-width: 20px; }
}

/* ============== HEADER TOAST (за quick OPEN) ============== */
.header-toast {
  position: fixed;
  top: calc(var(--header-total) + 12px);
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 200;
  transform: translateY(-12px);
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
}
.header-toast[hidden] { display: none !important; }
.header-toast.show { transform: translateY(0); opacity: 1; }
.header-toast.ok  { color: var(--success); border-color: rgba(74,222,128,0.4); }
.header-toast.err { color: var(--danger);  border-color: rgba(255,77,77,0.4); }

@media (max-width: 480px) {
  .header-toast { right: 10px; left: 10px; text-align: center; }
}

/* ============== HIDE-WHEN-EMPTY UTILITIES ============== */
/* Когато няма карта — contact-grid става 1 колона */
body.no-map .contact-grid { grid-template-columns: 1fr; }
body.no-map .contact-info { max-width: 640px; margin: 0 auto; }
body.no-map .contact-map  { display: none; }

/* Скриваме секции с празно съдържание */
section[hidden] { display: none !important; }
li[hidden] { display: none !important; }
p[hidden]  { display: none !important; }

/* ============== UTILITIES ============== */
.is-hidden { display: none !important; }
[hidden] { display: none !important; }

/* ============== GPS BANNER (sticky под header) ============== */
.gps-banner {
  position: sticky;
  /* Sticky ПОД notch/status bar — safe area остава прозрачна (body bg се вижда) */
  top: env(safe-area-inset-top, 0px);
  margin-top: env(safe-area-inset-top, 0px);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #0a0a0a;
  background: var(--accent);
  border-bottom: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.gps-banner.info {
  background: var(--accent);
  color: #0a0a0a;
}
.gps-banner.error {
  background: #ff4d4d;
  color: #fff;
  animation: gpsBannerPulse 2s ease-in-out infinite;
}
@keyframes gpsBannerPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(255,77,77,0.35); }
  50%      { box-shadow: 0 4px 24px rgba(255,77,77,0.65); }
}
.gps-banner-icon { font-size: 1.1rem; flex-shrink: 0; }
.gps-banner-text { flex: 1; line-height: 1.3; }
.gps-banner-btn {
  background: #0a0a0a;
  color: #fff;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.15s;
}
.gps-banner.error .gps-banner-btn {
  background: #fff;
  color: #ff4d4d;
}
.gps-banner-btn:hover { transform: scale(1.04); }
.gps-banner-btn:active { transform: scale(0.97); }
.gps-banner-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.12);
  color: inherit;
  font-size: 0.85rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gps-banner.error .gps-banner-close { background: rgba(255,255,255,0.2); }
.gps-banner-close:hover { background: rgba(0,0,0,0.22); }
@media (max-width: 480px) {
  .gps-banner { font-size: 0.8rem; padding: 9px 10px; gap: 7px; }
  .gps-banner-btn { padding: 6px 10px; font-size: 0.74rem; }
  .gps-banner-close { width: 26px; height: 26px; }
}

/* ============== INSTALL BANNER ============== */
.install-banner {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  margin-top: env(safe-area-inset-top, 0px);
  z-index: 85;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  border-bottom: 1px solid var(--border);
}
.install-banner-icon { font-size: 1.2rem; flex-shrink: 0; }
.install-banner-text { flex: 1; line-height: 1.3; }
.install-banner-btn {
  background: var(--accent);
  color: #0a0a0a;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}
.install-banner-btn:hover { background: var(--accent-dark); }
.install-banner-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 0.85rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.install-banner-close:hover { background: rgba(255,255,255,0.18); }
@media (max-width: 480px) {
  .install-banner { font-size: 0.8rem; padding: 9px 10px; gap: 7px; }
  .install-banner-btn { padding: 6px 10px; font-size: 0.74rem; }
}

/* ============== LOCATION HELP MODAL ============== */
.loc-help-modal,
.ios-install-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.loc-help-modal[hidden],
.ios-install-modal[hidden] { display: none; }

.loc-help-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.loc-help-dialog {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  max-height: 92dvh;
  max-height: calc(var(--vvh, 100vh) - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 22px 22px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
  animation: locHelpSlideUp 0.3s ease;
}
@keyframes locHelpSlideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@media (min-width: 600px) {
  .loc-help-modal,
  .ios-install-modal { align-items: center; }
  .loc-help-dialog { border-radius: var(--radius-lg); }
}
.loc-help-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loc-help-close:hover { background: #2a2a2a; }
.loc-help-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.loc-help-sub {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.loc-help-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.loc-help-tab {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s;
}
.loc-help-tab:hover { color: var(--text); }
.loc-help-tab.active {
  background: var(--accent);
  color: #0a0a0a;
}
.loc-help-callout {
  background: rgba(231,255,0,0.08);
  border: 1px solid rgba(231,255,0,0.3);
  border-left: 3px solid var(--accent);
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
}
.loc-help-steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}
.loc-help-steps li {
  counter-increment: step;
  position: relative;
  padding: 9px 0 9px 38px;
  font-size: 0.92rem;
  line-height: 1.45;
  border-bottom: 1px dashed var(--border);
}
.loc-help-steps li:last-child { border-bottom: none; }
.loc-help-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 9px;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: #0a0a0a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
}
.loc-help-hint {
  margin-top: 14px;
  padding: 11px 14px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.loc-help-hint b { color: var(--text); }
.loc-help-done {
  margin-top: 18px;
}

@media (max-width: 480px) {
  .loc-help-dialog { padding: 22px 18px 18px; }
  .loc-help-title { font-size: 1.4rem; }
  .loc-help-tab { padding: 6px 10px; font-size: 0.72rem; }
  .loc-help-steps li { font-size: 0.86rem; padding-left: 34px; }
  .loc-help-steps li::before { width: 24px; height: 24px; font-size: 0.74rem; }
}

/* ============== PASSWORD MODALS (forgot / reset / change) ============== */
.btn-link-forgot {
  display: block;
  margin: 12px auto 0;
  padding: 6px 12px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.btn-link-forgot:hover { color: var(--accent); }

.pw-modal-sub {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Гарантира че pw-модалите изглеждат като main модала */
.pw-modal .modal-dialog {
  max-width: 440px;
}

/* ============== GOOGLE SIGN-IN ============== */
.google-signin-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
}
.google-signin-wrapper[hidden] { display: none !important; }
#googleSignInBtn {
  width: 100%;
  display: flex;
  justify-content: center;
}
/* Override Google's button to fit our container */
#googleSignInBtn > div { max-width: 100%; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 14px 0 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  flex-shrink: 0;
  padding: 0 4px;
}

/* ============== ADMIN PUSH COMPOSER ============== */
.push-composer {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.push-composer-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.push-composer label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 12px;
  position: relative;
}
.push-composer input[type="text"],
.push-composer input[type="email"],
.push-composer textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s;
}
.push-composer input:focus,
.push-composer textarea:focus {
  border-color: var(--accent);
}
.push-composer textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.4;
}
.push-counter {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.push-target-group {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.push-target-group legend {
  padding: 0 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.push-radio {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  margin: 0 !important;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.push-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.push-radio span {
  flex: 1;
}
#push-target-email {
  margin-top: 8px;
}
#push-target-email[hidden] { display: none !important; }

.push-test-mode {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(231,255,0,0.06);
  border: 1px solid rgba(231,255,0,0.25);
  border-radius: 8px;
  margin-bottom: 14px !important;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.push-test-mode input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.push-composer .form-msg { margin: 0 0 12px; }

/* ============== ADMIN PUSH HISTORY ============== */
.push-history {
  padding: 12px 18px 24px;
}
.push-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 12px;
}
.push-history-header h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.push-history-refresh {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.push-history-refresh:hover { background: #2a2a2a; }

.push-history-item {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.push-history-item.err { border-left-color: var(--danger); }

.push-hist-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.push-hist-time { font-weight: 600; }
.push-hist-type {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.push-hist-type.marketing {
  background: rgba(231,255,0,0.18);
  color: var(--accent);
}
.push-hist-type.transactional {
  background: rgba(96,165,250,0.18);
  color: #60a5fa;
}
.push-hist-count {
  margin-left: auto;
  font-weight: 600;
  color: var(--text);
}
.push-hist-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.push-hist-body {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 6px;
}
.push-hist-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.push-hist-err {
  color: var(--danger);
  font-weight: 500;
}

@media (max-width: 480px) {
  .push-composer { padding: 14px 14px; }
  .push-composer-title { font-size: 1.2rem; }
  .push-history { padding: 10px 14px 24px; }
  .push-history-item { padding: 10px; }
}

/* ============== PUSH OPT-OUT TOGGLE (в Profile) ============== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-top: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
}
.toggle-row[hidden] { display: none !important; }
.toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
}
.toggle-icon { font-size: 1.2rem; line-height: 1.2; flex-shrink: 0; }
.toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.9rem;
  color: var(--text);
}
.toggle-text b { font-weight: 700; font-size: 0.92rem; }
.toggle-text small {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.35;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #404040;
  border-radius: 24px;
  cursor: pointer;
  transition: 0.25s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #0a0a0a;
}

/* ============== SETTINGS MODAL — Fitness redesign ============== */
.settings-dialog {
  max-width: 480px;
  padding: 22px 20px 18px !important;
  background: linear-gradient(180deg, var(--bg-elev) 0%, var(--surface) 100%);
}

/* --- Header --- */
.settings-header {
  margin: 0 0 16px;
  padding-right: 36px;  /* space for close button */
}
.settings-header-eyebrow {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 4px;
}
.settings-header-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1;
}

/* --- STREAK HERO CARD --- */
.streak-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;
}
.streak-hero::before {
  /* Subtle background glow */
  content: '';
  position: absolute;
  inset: -2px;
  background: radial-gradient(circle at 0% 50%, rgba(255,107,53,0.15) 0%, transparent 50%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}
.streak-hero.active::before {
  opacity: 1;
}
.streak-hero.active {
  border-color: rgba(255,107,53,0.35);
  box-shadow: 0 0 24px rgba(255,107,53,0.15);
}
.streak-hero-fire {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  background: linear-gradient(135deg, rgba(255,107,53,0.12) 0%, rgba(255,1,60,0.12) 100%);
  border-radius: 50%;
  border: 2px solid rgba(255,107,53,0.25);
  filter: grayscale(1);
  transition: all 0.3s;
}
.streak-hero.active .streak-hero-fire {
  filter: none;
  border-color: rgba(255,107,53,0.6);
  background: linear-gradient(135deg, rgba(255,107,53,0.25) 0%, rgba(255,1,60,0.25) 100%);
  animation: heroFireGlow 2s ease-in-out infinite;
}
@keyframes heroFireGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,53,0.4); }
  50%      { box-shadow: 0 0 0 14px rgba(255,107,53,0); }
}
.streak-hero-content { flex: 1; min-width: 0; }
.streak-hero-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.streak-hero-num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 8px;
}
.streak-hero.active .streak-hero-num {
  background: linear-gradient(135deg, #ff8c00 0%, #ff013c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.streak-hero-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.streak-hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.streak-hero-stat[hidden] { display: none; }
.streak-hero-stat b {
  color: var(--text);
  font-weight: 700;
}
.streak-hero-stat-icon {
  font-size: 0.85rem;
  line-height: 1;
}

/* --- INFO GRID (План + Остават) --- */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.info-card {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.info-card-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.info-card-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1.15;
}
.info-card-value.danger { color: var(--danger); }
.info-card-value.warn { color: #f97316; }
.info-card-value.ok { color: var(--accent); }

/* --- CONTACT INFO LIST (email + phone + gps) --- */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
  padding: 6px 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.info-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  font-size: 0.87rem;
}
.info-list-row[hidden] { display: none; }
.info-list-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  color: var(--accent);
}
.info-list-icon svg {
  width: 18px;
  height: 18px;
}
.info-list-value {
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
  min-width: 0;
}

/* --- Toggle row (push) — без border-box, защото е card-like --- */
.settings-modal .toggle-row {
  margin: 0 0 8px;
}
.settings-modal .toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--accent);
  background: rgba(231,255,0,0.1);
  border-radius: 50%;
  font-size: 1rem;
}

/* --- Settings item (Промени парола) --- */
.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.92rem;
  transition: all 0.15s;
}
.settings-item:hover {
  border-color: var(--accent);
  background: var(--surface);
}
.settings-item:active {
  transform: scale(0.99);
}
.settings-item-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--accent);
  background: rgba(231,255,0,0.1);
  border-radius: 10px;
}
.settings-item-icon svg {
  width: 20px;
  height: 20px;
}
.settings-item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-item-text b {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.settings-item-text small {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.settings-item-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
}

/* --- Profile footer (Настройки + Изход) — компактен toolbar --- */
.profile-footer {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.btn-icon-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-icon-pill:hover {
  border-color: var(--accent);
  background: var(--surface);
}
.btn-icon-pill:active { transform: scale(0.97); }
.btn-icon-pill svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btn-icon-pill.ghost-danger {
  color: var(--text-muted);
}
.btn-icon-pill.ghost-danger:hover {
  border-color: rgba(255,77,77,0.5);
  color: var(--danger);
  background: rgba(255,77,77,0.05);
}

@media (max-width: 480px) {
  .settings-dialog { padding: 20px 16px 14px !important; }
  .settings-header-title { font-size: 1.5rem; }
  .streak-hero { padding: 14px 16px; gap: 12px; }
  .streak-hero-fire { width: 60px; height: 60px; font-size: 2.3rem; }
  .streak-hero-num { font-size: 2.2rem; }
  .info-card { padding: 10px 12px; }
  .info-card-value { font-size: 1.1rem; }
  .info-list-row { padding: 8px 12px; font-size: 0.83rem; }
}

/* ============== BOTTOM NAV (logged-in PWA navigation) ============== */
.bottom-nav {
  position: fixed;
  bottom: 14px;
  left: 14px;
  right: 14px;
  z-index: 90;
  display: grid;
  /* 5 equal колони — всеки бутон си има точно равен слот */
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  justify-items: center;
  height: 62px;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  max-width: 520px;
  margin: 0 auto;
}
.bottom-nav[hidden] { display: none !important; }

.bn-item {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 0;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, transform 0.1s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
/* Фиксиран „icon slot" — гарантира че иконите са на същата височина */
.bn-item > svg,
.bn-item > .bn-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.bn-item > svg {
  stroke-width: 2;
  transition: transform 0.15s;
}
.bn-item span:last-child {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
}
.bn-item:hover { color: var(--text); }
.bn-item:active { transform: scale(0.92); }
.bn-item.active { color: var(--accent); }
.bn-item.active > svg { transform: scale(1.08); }

/* Avatar в Profile bn-item — буква от името ИЛИ Google profile picture */
.bn-item .bn-avatar {
  position: relative;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  border: 1.5px solid transparent;
  transition: all 0.2s;
  line-height: 1;
  overflow: hidden;  /* за да clip-ва картинката в кръга */
}
.bn-item .bn-avatar.logged-in {
  background: var(--accent);
  color: #0a0a0a;
  border-color: rgba(231,255,0,0.4);
}
/* Google profile picture — fills the whole circle */
.bn-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.bn-avatar-img[hidden] { display: none !important; }
.bn-avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.bn-avatar-letter[hidden] { display: none !important; }

/* ============== FAB (Floating Action Button — централен OPEN) ============== */
.bn-fab {
  position: relative;
  width: 64px;
  height: 64px;
  margin-top: -28px;  /* elevated над линията на nav */
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #ff013c 0%, #ff6b35 100%);
  box-shadow: 0 8px 24px rgba(255,1,60,0.45),
              0 0 0 4px var(--bg);
  transition: transform 0.15s, box-shadow 0.25s;
  -webkit-tap-highlight-color: transparent;
  justify-self: center;
  align-self: center;
}
.bn-fab:active {
  transform: scale(0.92);
}
.bn-fab:disabled {
  cursor: wait;
  opacity: 0.95;
}
.bn-fab-icon {
  width: 28px;
  height: 28px;
  filter: drop-shadow(1px 0 0 #00e6f6) drop-shadow(-1px 0 0 #f8f005);
  position: relative;
  z-index: 2;
}

/* Status colors (FAB следва същата logика като btn-open) */
.bn-fab.status-unlimited {
  background: linear-gradient(135deg, #e7ff00 0%, #c5d800 100%);
  color: #0a0a0a;
  box-shadow: 0 8px 24px rgba(231,255,0,0.45), 0 0 0 4px var(--bg);
}
.bn-fab.status-good {
  background: linear-gradient(135deg, #16a34a 0%, #4ade80 100%);
  box-shadow: 0 8px 24px rgba(22,163,74,0.5), 0 0 0 4px var(--bg);
}
.bn-fab.status-soon {
  background: linear-gradient(135deg, #a3e635 0%, #65a30d 100%);
  color: #0a0a0a;
  box-shadow: 0 8px 24px rgba(132,204,22,0.5), 0 0 0 4px var(--bg);
}
.bn-fab.status-warning {
  background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
  box-shadow: 0 8px 24px rgba(249,115,22,0.5), 0 0 0 4px var(--bg);
}
.bn-fab.status-danger {
  background: linear-gradient(135deg, #ff013c 0%, #dc2626 100%);
  box-shadow: 0 8px 24px rgba(255,1,60,0.55), 0 0 0 4px var(--bg);
}
.bn-fab.status-critical {
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
  animation: fabCriticalPulse 1.2s ease-in-out infinite;
}
@keyframes fabCriticalPulse {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(220,38,38,0.6),
                0 0 0 4px var(--bg),
                0 0 0 6px rgba(220,38,38,0.4);
  }
  50% {
    box-shadow: 0 8px 24px rgba(220,38,38,0.8),
                0 0 0 4px var(--bg),
                0 0 0 18px rgba(220,38,38,0);
  }
}

/* Opening state — FAB-ът „пулсира" по време на API call */
.bn-fab.opening {
  animation: fabOpening 0.7s ease-in-out infinite;
}
@keyframes fabOpening {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

/* Body padding-bottom за да не се крие content под bottom nav */
body.has-bottom-nav main {
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}
body.has-bottom-nav .footer {
  padding-bottom: calc(30px + 90px + env(safe-area-inset-bottom));
}

/* Mobile — малко по-плътно */
@media (max-width: 480px) {
  .bottom-nav {
    bottom: 10px;
    left: 10px;
    right: 10px;
    height: 58px;
  }
  .bn-item span:last-child { font-size: 0.6rem; }
  .bn-item > svg,
  .bn-item > .bn-avatar { width: 22px; height: 22px; }
  .bn-fab { width: 60px; height: 60px; margin-top: -26px; }
  .bn-fab-icon { width: 26px; height: 26px; }
}

/* Desktop — bottom nav изглежда странно широк, ограничаваме max-width */
@media (min-width: 768px) {
  .bottom-nav { max-width: 480px; }
}

/* ============== ADMIN PRESENCE CARD ============== */
.presence-card {
  margin: 12px 16px 6px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1a1a1a 0%, #232323 100%);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.presence-card.active {
  border-color: rgba(74,222,128,0.4);
  box-shadow: 0 0 18px rgba(74,222,128,0.12);
}
.presence-card.busy {
  border-color: rgba(231,255,0,0.5);
  box-shadow: 0 0 24px rgba(231,255,0,0.18);
}

.presence-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  text-align: left;
}
.presence-card-header:hover {
  background: rgba(255,255,255,0.02);
}

.presence-icon-circle {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(231,255,0,0.08);
  border: 1.5px solid rgba(231,255,0,0.25);
  color: var(--accent);
}
.presence-icon-circle svg { width: 22px; height: 22px; }

.presence-card.active .presence-icon-circle {
  background: rgba(74,222,128,0.15);
  border-color: rgba(74,222,128,0.45);
  color: var(--success);
}
.presence-card.busy .presence-icon-circle {
  background: rgba(231,255,0,0.2);
  border-color: rgba(231,255,0,0.6);
  animation: presenceBusyPulse 2s ease-in-out infinite;
}
@keyframes presenceBusyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,255,0,0.4); }
  50%      { box-shadow: 0 0 0 10px rgba(231,255,0,0); }
}

.presence-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.presence-count {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--text);
}
.presence-card.active .presence-count { color: var(--success); }
.presence-card.busy .presence-count { color: var(--accent); }
.presence-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.presence-toggle {
  flex-shrink: 0;
  font-size: 1rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.presence-list {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.presence-list[hidden] { display: none; }

.presence-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: 10px;
}
.presence-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #0a0a0a;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
}
.presence-row-info {
  flex: 1;
  min-width: 0;
}
.presence-row-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.presence-row-when {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.presence-empty {
  padding: 14px 12px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border-radius: 10px;
}

@media (max-width: 480px) {
  .presence-card { margin: 10px 12px 6px; }
  .presence-card-header { padding: 12px 14px; gap: 12px; }
  .presence-icon-circle { width: 42px; height: 42px; }
  .presence-icon-circle svg { width: 20px; height: 20px; }
  .presence-count { font-size: 1.4rem; }
}

/* ============== ACTIVITY MODAL — 30-day bar chart ============== */
.activity-dialog {
  max-width: 480px;
}
.activity-chart-card {
  margin-top: 14px;
  padding: 14px 14px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.activity-chart-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.visits-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 90px;
  padding: 4px 0;
}
.visit-bar {
  flex: 1;
  min-width: 6px;
  height: 100%;
  background: var(--surface);
  border-radius: 3px 3px 0 0;
  position: relative;
  transition: opacity 0.15s, transform 0.15s;
  cursor: pointer;
}
.visit-bar > .visit-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(231,255,0,0.3) 100%);
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease-out;
  min-height: 2px;
}
.visit-bar.empty > .visit-bar-fill { display: none; }
.visit-bar.today { box-shadow: 0 0 0 1.5px var(--accent); }
.visit-bar:hover {
  transform: translateY(-2px);
}
.visit-bar:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  padding: 4px 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 6px;
  border: 1px solid var(--border);
  pointer-events: none;
  z-index: 10;
}
.visits-chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.66rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ============== STREAK BADGE (в settings) ============== */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.streak-badge.active {
  color: #fff;
  background: linear-gradient(135deg, #ff6b35 0%, #ff013c 100%);
  border-color: rgba(255,107,53,0.5);
  box-shadow: 0 0 12px rgba(255,107,53,0.4);
  animation: streakPulse 2s ease-in-out infinite;
}
@keyframes streakPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(255,107,53,0.4); }
  50%      { box-shadow: 0 0 18px rgba(255,107,53,0.7); }
}

/* ============== PUSH PERMISSION MODAL ============== */
.push-perm-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.push-perm-modal[hidden] { display: none; }
.push-perm-dialog {
  text-align: center;
  padding: 28px 24px 22px !important;
}
@media (min-width: 600px) {
  .push-perm-modal { align-items: center; }
}
.push-perm-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  background: rgba(231,255,0,0.12);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  animation: pushPermPulse 1.5s ease-in-out infinite;
}
@keyframes pushPermPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,255,0,0.5); }
  50%      { box-shadow: 0 0 0 12px rgba(231,255,0,0); }
}
.push-perm-title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.push-perm-text {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.push-perm-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  text-align: left;
}
.push-perm-list li {
  padding: 8px 12px;
  margin-bottom: 6px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.4;
}
.push-perm-list b { font-weight: 700; }
.push-perm-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.push-perm-actions .btn { margin: 0 !important; }

@media (max-width: 480px) {
  .push-perm-dialog { padding: 24px 20px 18px !important; }
  .push-perm-icon { width: 64px; height: 64px; font-size: 2rem; }
  .push-perm-title { font-size: 1.5rem; }
}

/* ============== LOCATION SOFT PROMPT — зелен accent ============== */
.loc-soft-modal .push-perm-icon {
  background: rgba(74,222,128,0.12);
  border-color: var(--success);
  animation: locPinPulse 1.5s ease-in-out infinite;
}
@keyframes locPinPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0.5); }
  50%      { box-shadow: 0 0 0 14px rgba(74,222,128,0); }
}
.loc-soft-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  text-align: left;
}
.loc-soft-list li {
  padding: 9px 14px;
  margin-bottom: 6px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--text);
}
.loc-soft-list li b { color: var(--text); font-weight: 700; }

/* „Не сега" — subtle text link под primary бутона, за да не се натиска случайно */
.loc-soft-later-btn {
  display: block;
  margin: 12px auto 0;
  padding: 6px 14px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.loc-soft-later-btn:hover { color: var(--text); }
.loc-soft-later-btn:active { transform: scale(0.97); }

/* ===================================================
   ВЪТРЕШЕН ПРАВИЛНИК — checkbox, модал, бутони
   =================================================== */

/* Бутон "Виж условията" — над checkbox-а */
.btn-view-terms {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-view-terms:hover {
  background: rgba(231, 255, 0, 0.06);
  border-color: var(--accent);
  border-style: solid;
}
.btn-view-terms:active { transform: scale(0.98); }

/* Checkbox в регистрационната форма — custom styled (винаги видим) */
.reg-terms-check {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
  margin-top: 8px;
  user-select: none;
  transition: border-color 0.15s;
}
.reg-terms-check:hover { border-color: var(--accent); }
.reg-terms-check:has(input:checked) {
  border-color: var(--accent);
  background: rgba(231, 255, 0, 0.06);
}

/* Custom checkbox (appearance: none → пълен контрол върху визуализацията) */
.reg-terms-check input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
  transition: all 0.15s;
  margin: 0;
}
.reg-terms-check input[type=checkbox]:hover { border-color: var(--accent); }
.reg-terms-check input[type=checkbox]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.reg-terms-check input[type=checkbox]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0a;
  font-weight: 900;
  font-size: 17px;
  line-height: 1;
}
.reg-terms-check span { flex: 1; font-weight: 500; }

/* Footer бутон за правилника */
.footer-rules-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.footer-rules-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}
.footer-rules-btn:active { transform: scale(0.97); }
.footer-rules-btn svg { width: 14px; height: 14px; flex: 0 0 auto; }

/* Row layout за Правилник + Чат в profile pane */
.profile-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.profile-actions-row .btn-link-rules-profile {
  flex: 1;
  margin-top: 0;
  min-width: 0;
  justify-content: center;
  padding: 10px 8px;
  font-size: 12.5px;
}
.profile-actions-row .btn-link-rules-profile span:not([class]) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Профил chat бутон — нов unread badge */
.profile-chat-btn .warning-badge {
  margin-left: auto;
  background: var(--accent);
  color: #0a0a0a;
  border-color: var(--accent);
  font-weight: 800;
}
.profile-chat-btn:has(.warning-badge:not([hidden])) {
  border-color: var(--accent);
}

/* Бутон в профила */
.btn-link-rules-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  margin-top: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
/* Когато има предупреждение — бутонът става червен за да привлече внимание */
.btn-link-rules-profile:has(#rulesBtnWarningDot:not([hidden])) {
  border-color: var(--danger);
  color: var(--danger);
}
.btn-link-rules-profile #rulesBtnWarningDot {
  position: relative;
  top: 0; right: 0;
  margin-left: auto;
}
.btn-link-rules-profile:hover {
  color: var(--text);
  border-color: var(--accent);
}
.btn-link-rules-profile:active { transform: scale(0.98); }
.btn-link-rules-profile svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* Rules модал — съдържание */
.rules-dialog { max-width: 560px; }

/* Warning banner вътре в rules модала */
.rules-warning-banner {
  display: flex;
  gap: 12px;
  margin: 14px 0 18px;
  padding: 14px;
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.35);
  border-radius: var(--radius);
  text-align: left;
}
.rules-warning-banner-icon {
  font-size: 24px;
  line-height: 1;
  flex: 0 0 auto;
}
.rules-warning-banner-body { flex: 1; min-width: 0; }
.rules-warning-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}
.rules-warning-banner-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.rules-warning-banner-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
}
.rules-warning-banner-list li:last-child { margin-bottom: 0; }
.rules-warning-banner-list li b { color: var(--danger); }
.rwb-note {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
  padding-left: 8px;
  border-left: 2px solid var(--accent);
}
.rwb-date {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.rules-content {
  text-align: left;
  margin: 16px 0 20px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 55vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
}
.rules-content h4 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}
.rules-content h5 {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.rules-content h5:first-of-type { margin-top: 6px; }
.rules-content p {
  margin: 6px 0;
  color: var(--text-muted);
}
.rules-content ul {
  margin: 6px 0 10px;
  padding-left: 20px;
  color: var(--text-muted);
}
.rules-content li { margin: 3px 0; }
.rules-content b { color: var(--text); }

/* Светъл режим adjustments */
/* ===================================================
   ПРЕДУПРЕЖДЕНИЯ — badge, dot, composer, notification
   =================================================== */

/* Risk dot в admin user card head (anti-sharing detection) */
.user-risk-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  vertical-align: middle;
  box-shadow: 0 0 0 1px currentColor;
}
.user-risk-dot.risk-dot-high {
  background: var(--danger);
  color: var(--danger);
  animation: warn-pulse 2s infinite;
}
.user-risk-dot.risk-dot-medium {
  background: #ff9500;
  color: #ff9500;
}

/* Warning badge в admin user card head */
.warning-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(255, 77, 77, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 77, 77, 0.4);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Червена точка на profile avatar (малка + голяма версия) */
.warning-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: var(--danger);
  border: 2px solid var(--bg);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 0 1px rgba(255,77,77,0.4);
  animation: warn-pulse 2s infinite;
}
.warning-dot-lg {
  width: 16px;
  height: 16px;
  border-width: 3px;
  top: -3px;
  right: -3px;
}
.warning-dot[data-count]:not([data-count="1"])::after {
  content: attr(data-count);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 700;
  color: white;
}
.warning-dot-lg[data-count]:not([data-count="1"])::after { font-size: 10px; }
@keyframes warn-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,77,77,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(255,77,77,0); }
}

/* Profile avatar и bn-avatar трябва да са position:relative за да позиционираме точката */
.profile-avatar, .bn-avatar { position: relative; }

/* Action menu warn item — жълто-оранжев акцент */
.action-menu-item.warn {
  color: #ff9500;
}
.action-menu-item.warn:hover {
  background: rgba(255, 149, 0, 0.1);
}

/* Warning composer модал (admin) — z-index над admin-modal (110) и action-menu (120) */
#warnUserModal { z-index: 130; }
#warnUserModal .modal-dialog { max-width: 480px; }
.warn-target-info {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 0 16px;
  text-align: left;
}
.warn-target-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.warn-target-email {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.warn-target-count {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.warn-target-count.warn-count-high {
  color: var(--danger);
}
#warnUserForm select,
#warnUserForm textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
#warnUserForm select:focus,
#warnUserForm textarea:focus {
  outline: none;
  border-color: var(--accent);
}
#warnUserForm textarea { resize: vertical; min-height: 70px; }
#warnUserForm optgroup { font-weight: 700; color: var(--text); }
#warnUserForm option { background: var(--surface); color: var(--text); }

.warn-final-hint {
  background: rgba(255, 149, 0, 0.08);
  border: 1px solid rgba(255, 149, 0, 0.3);
  color: #ff9500;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-top: 12px;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.modal-actions .btn { flex: 1; min-width: 0; }

/* На тесни екрани (телефон) — стекваме вертикално, primary action отгоре */
@media (max-width: 480px) {
  .modal-actions {
    flex-direction: column;
    gap: 8px;
  }
  .modal-actions .btn {
    width: 100%;
    padding: 14px 16px;
  }
}

.btn-warn {
  background: #ff9500;
  color: #1a1a1a;
  border: 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-warn:hover { background: #e08600; }
.btn-warn:active { transform: scale(0.98); }
.btn-warn:disabled { opacity: 0.6; cursor: wait; }

/* USER WARNING NOTIFICATION модал (blocking, red top bar) — най-висок z-index */
#userWarningModal { z-index: 250; }
.modal-warning .modal-backdrop {
  background: rgba(0, 0, 0, 0.85);
  pointer-events: none; /* не може да се затвори с клик отвън */
}
.warning-dialog {
  text-align: center;
  border-top: 4px solid var(--danger);
  max-width: 420px;
}
.warning-icon {
  font-size: 48px;
  margin-bottom: 8px;
  animation: warn-shake 0.6s ease;
}
@keyframes warn-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px) rotate(-3deg); }
  40%      { transform: translateX(6px) rotate(3deg); }
  60%      { transform: translateX(-4px) rotate(-2deg); }
  80%      { transform: translateX(4px) rotate(2deg); }
}
#userWarningModal .modal-title {
  color: var(--danger);
  font-size: 22px;
  margin-bottom: 16px;
}
.warning-rule-point {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.3);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 12px;
  font-weight: 500;
  text-align: left;
}
.warning-note {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 12px;
  text-align: left;
}
.warning-count-text {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 0 16px;
}
.warning-count-text.warn-count-final {
  color: var(--danger);
  font-size: 14px;
}

@media (prefers-color-scheme: light) {
  .warn-target-info,
  .warning-rule-point,
  .warning-note,
  .modal-warning .modal-backdrop {
    /* запазват се същите стилове — изглеждат добре и на двата режима */
  }
}

/* ===================================================
   ЧЛЕНСКИ ВНОС (membership pricing) модал
   =================================================== */

/* Hero pricing бутон (трета CTA option под Запиши се / Влез) */
.btn-hero-pricing {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-hero-pricing:hover {
  background: rgba(231, 255, 0, 0.08);
  border-color: var(--accent);
}
.btn-hero-pricing:active { transform: scale(0.97); }

/* Membership модал — широк за grid */
.membership-dialog { max-width: 980px; padding: 28px 24px; }
.membership-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin: -8px 0 24px;
  font-size: 14px;
}

/* Grid: 3 cols desktop, 2 cols tablet, 1 col mobile */
.membership-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 860px) {
  .membership-grid { grid-template-columns: repeat(2, 1fr); }
  .membership-dialog { max-width: 680px; }
}
@media (max-width: 540px) {
  .membership-grid { grid-template-columns: 1fr; }
}

/* Карта */
.membership-card {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, border-color 0.15s;
}
.membership-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.membership-card.is-popular {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(231, 255, 0, 0.25), 0 12px 30px rgba(0,0,0,0.4);
  transform: translateY(-4px);
}
.membership-popular {
  position: absolute;
  top: -1px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #0a0a0a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 4px 14px;
  border-radius: 0 0 8px 8px;
  z-index: 2;
}

.membership-card-img {
  aspect-ratio: 1 / 1;
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.membership-card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.membership-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.membership-card-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}
.membership-card-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.membership-card-price .amount {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}
.membership-card-price .period {
  font-size: 13px;
  color: var(--text-muted);
}
.membership-card-desc {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted);
}
.membership-join { margin-top: auto; }

.membership-disclaimer {
  margin-top: 22px;
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

/* Phone prompt модал (blocking, без backdrop close) */
#phonePromptModal { z-index: 200; }
.phone-prompt-dialog {
  max-width: 400px;
  text-align: center;
  border-top: 4px solid var(--accent);
}
.phone-prompt-icon {
  font-size: 42px;
  margin-bottom: 8px;
}
.phone-prompt-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 12px 0 18px;
}
#phonePromptForm label {
  text-align: left;
}

/* Admin action menu: chat item стил */
.action-menu-item.chat {
  color: var(--accent);
}
.action-menu-item.chat:hover {
  background: rgba(231, 255, 0, 0.08);
}

/* Contact admin модал — z-index над membership (100) */
#contactAdminModal { z-index: 140; }
.contact-admin-dialog { max-width: 380px; text-align: center; }
.contact-admin-plan {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 12px 0;
}
.contact-admin-plan b { color: var(--accent); }
.contact-admin-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 18px;
}
#contactAdminModal .btn { margin-bottom: 8px; }

/* ===================================================
   ЧАТ (Cloudflare Worker + WebSocket)
   - User: fullscreen modal (chatModal)
   - Admin: 2-column layout вътре в admin-pane[data-admintab="chat"]
   =================================================== */

/* Червена точка за непрочетени съобщения — на profile-avatar + bn-avatar */
.chat-unread-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: var(--danger);
  border: 2px solid var(--bg);
  border-radius: 50%;
  z-index: 3;
  box-shadow: 0 0 0 1px rgba(255,77,77,0.4);
  animation: warn-pulse 2s infinite;
}
.chat-unread-dot-lg {
  width: 18px;
  height: 18px;
  border-width: 3px;
}
.chat-unread-dot[hidden] { display: none; }

/* Специален случай: profile-avatar е 100%-wide flex контейнер с центрирана
   76x76 avatar circle вътре. Позиционираме точката спрямо центъра, не спрямо контейнера. */
#profileChatUnreadDot.chat-unread-dot {
  top: 0 !important;
  right: auto !important;
  left: 50% !important;
  transform: translateX(20px);
}

/* Glow на нови (непрочетени) bubble-и в чата */
.chat-bubble.unread {
  animation: chat-bubble-glow 1.2s ease-in-out 0s 3;
  position: relative;
}
@keyframes chat-bubble-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 255, 0, 0); }
  50%      { box-shadow: 0 0 0 4px rgba(231, 255, 0, 0.5), 0 0 14px rgba(231, 255, 0, 0.45); }
}
.chat-bubble.theirs.unread {
  /* за theirs (другата страна) — по-наситен жълт glow */
  border: 1px solid rgba(231, 255, 0, 0.5);
}

/* Separator пред първото непрочетено съобщение */
.chat-unread-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.4px;
}
.chat-unread-sep::before,
.chat-unread-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 255, 0, 0.5), transparent);
}
.chat-unread-sep span {
  white-space: nowrap;
  padding: 3px 10px;
  background: rgba(231, 255, 0, 0.1);
  border-radius: 999px;
}

/* Bottom nav chat icon + badge */
.bn-chat-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bn-chat-icon svg {
  width: 22px;
  height: 22px;
}
.bn-chat-badge,
.admin-chat-badge {
  position: absolute;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  letter-spacing: 0;
}
.bn-chat-badge { top: -4px; right: -8px; }
.admin-chat-badge {
  position: relative;
  margin-left: 6px;
  top: -1px;
}

/* User chat fullscreen modal */
.chat-modal {
  position: fixed; inset: 0;
  z-index: 115;
  background: var(--bg);
  display: flex; flex-direction: column;
  animation: fade-in 0.2s ease;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.chat-modal[hidden] { display: none; }
.chat-modal-inner {
  display: flex; flex-direction: column;
  height: 100%;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* Chat header (user side) */
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  position: sticky; top: 0; z-index: 5;
}
.chat-back {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 1.4rem;
  color: var(--text);
  background: transparent; border: 0;
  cursor: pointer;
}
.chat-back:hover { background: var(--surface); }
.chat-header-title {
  flex: 1;
  display: flex; flex-direction: column;
  min-width: 0;
}
.chat-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.chat-status {
  font-size: 11px;
  color: var(--text-muted);
}
.chat-status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  flex: 0 0 auto;
  transition: background 0.2s;
}
.chat-status-dot.connected { background: var(--success); box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2); }
.chat-status-dot.connecting { background: var(--accent); animation: pulse-dot 1.2s infinite; }
.chat-status-dot.disconnected { background: var(--text-muted); }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Messages container */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}
.chat-empty, .chat-loading, .chat-error {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 20px;
  line-height: 1.5;
}
.chat-empty small { font-size: 11px; color: var(--text-muted); opacity: 0.75; }
.chat-error { color: var(--danger); }

.chat-day-sep {
  align-self: center;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 3px 12px;
  border-radius: 999px;
  margin: 10px 0 4px;
  letter-spacing: 0.3px;
}

/* Bubbles */
.chat-bubble {
  max-width: 78%;
  border-radius: 18px;
  padding: 8px 12px 6px;
  margin-bottom: 2px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  animation: bubble-in 0.18s ease;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-bubble.mine {
  align-self: flex-end;
  background: var(--accent);
  color: #0a0a0a;
  border-bottom-right-radius: 5px;
}
.chat-bubble.theirs {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 5px;
}
.chat-bubble-body {
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.chat-bubble-meta {
  font-size: 10px;
  margin-top: 3px;
  text-align: right;
  opacity: 0.65;
}
.chat-bubble.mine .chat-bubble-meta { color: #1a1a1a; }
.chat-bubble.theirs .chat-bubble-meta { color: var(--text-muted); }

/* Composer */
.chat-composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.chat-composer textarea {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  resize: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
  outline: none;
}
.chat-composer textarea:focus {
  border-color: var(--accent);
}
.chat-send {
  width: 44px; height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0a0a;
  border: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.chat-send:hover { background: var(--accent-dark); }
.chat-send:active { transform: scale(0.93); }
.chat-send svg { width: 18px; height: 18px; }

/* ============== ADMIN CHAT LAYOUT ============== */
/* Само когато pane-ът НЕ е hidden показваме flex layout — иначе [hidden] го скрива */
.admin-pane-chat[hidden] { display: none !important; }
.admin-pane-chat:not([hidden]) {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);  /* fallback */
  height: calc(100dvh - 200px);
}
.admin-chat-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  background: var(--bg);
}
.conv-list {
  width: 320px;
  flex: 0 0 auto;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--bg-elev);
}
.conv-list-empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.conv-item:hover, .conv-item.active {
  background: var(--surface-2);
}
.conv-item.active {
  border-left: 3px solid var(--accent);
  padding-left: 11px;
}
.conv-avatar {
  position: relative;
  width: 40px; height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.conv-avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.conv-avatar-letter {
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
.conv-meta {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column;
  gap: 2px;
}
.conv-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}
.conv-time {
  font-size: 10px;
  color: var(--text-muted);
}
.conv-unread {
  background: var(--accent);
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.conv-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.conv-panel-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
}
.conv-panel-active {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.conv-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.conv-back {
  width: 36px; height: 36px;
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}
.conv-back:hover { background: var(--surface); }
.conv-header-info {
  flex: 1;
  min-width: 0;
}
.conv-header-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.conv-header-email {
  font-size: 11px;
  color: var(--text-muted);
}
/* ===================================================
   SECURITY TAB (Anti-Sharing Detection Dashboard)
   =================================================== */
.admin-pane-security[hidden] { display: none !important; }
.admin-pane-security:not([hidden]) {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  height: calc(100dvh - 200px);
}
.admin-chat-layout,
.admin-security-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  background: var(--bg);
}
.admin-security-layout { flex: 1; }
.security-list {
  width: 320px;
  flex: 0 0 auto;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--bg-elev);
}
.security-list-empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.security-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.security-detail-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 30px;
  text-align: center;
}
.security-detail-active {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.security-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.security-detail-info {
  flex: 1;
  min-width: 0;
}
.security-detail-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.security-detail-email {
  font-size: 11px;
  color: var(--text-muted);
}
.security-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.security-section {
  margin-bottom: 24px;
}
.security-section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.security-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--surface-2);
  border-radius: var(--radius);
}

/* Risk badges — color-coded */
.security-risk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.security-risk-badge.risk-low { background: rgba(74, 222, 128, 0.15); color: var(--success); border: 1px solid rgba(74,222,128,0.3); }
.security-risk-badge.risk-medium { background: rgba(255, 149, 0, 0.18); color: #ff9500; border: 1px solid rgba(255,149,0,0.35); }
.security-risk-badge.risk-high { background: rgba(255, 77, 77, 0.18); color: var(--danger); border: 1px solid rgba(255,77,77,0.4); animation: warn-pulse 2s infinite; }
.admin-security-badge {
  position: relative;
  margin-left: 6px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  top: -1px;
}

/* Security list items styled like conv items */
.security-item .security-risk-badge {
  min-width: 30px;
  height: 22px;
  font-size: 11px;
}

/* Score breakdown */
.security-breakdown {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.breakdown-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  flex: 0 0 auto;
  min-width: 150px;
}
.breakdown-detail {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
}
.breakdown-points {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--danger);
  background: rgba(255, 77, 77, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.breakdown-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-elev);
  border-top: 2px solid var(--border);
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.5px;
}
.breakdown-total-score {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--accent);
}

/* Linked accounts — обогатени с avatar + name + phone */
.security-linked {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.security-linked-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 77, 77, 0.06);
  border: 1px solid rgba(255, 77, 77, 0.25);
  border-radius: var(--radius);
}
.linked-avatar {
  width: 42px; height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.linked-avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.linked-avatar-letter {
  font-weight: 700;
  font-size: 17px;
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
.linked-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.linked-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.linked-email {
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
}
.linked-phone-row {
  margin-top: 2px;
}
.linked-phone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--danger);
  font-weight: 600;
  text-decoration: none;
}
.linked-phone:hover { text-decoration: underline; }
.linked-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  flex: 0 0 auto;
}
.security-linked-badge {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Map */
.security-map {
  height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.security-map .leaflet-container {
  background: var(--surface-2);
  font-family: inherit;
}

/* Devices */
.security-devices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.security-device {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.security-device-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.security-device-icon {
  font-size: 22px;
  flex: 0 0 auto;
}
.security-device-info {
  flex: 1;
  min-width: 0;
}
.security-device-os {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.security-device-fp {
  font-size: 10px;
  color: var(--text-muted);
  font-family: monospace;
}
.security-device-count {
  background: var(--accent);
  color: #0a0a0a;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.security-device-meta {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
}

/* Timeline */
.security-timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.security-event {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.security-event-icon {
  font-size: 16px;
  flex: 0 0 auto;
  width: 22px;
  text-align: center;
}
.security-event-body { flex: 1; min-width: 0; }
.security-event-line {
  font-size: 12.5px;
  color: var(--text);
}
.security-event-line b { color: var(--accent); }
.security-event-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.security-event-meta .dim { opacity: 0.5; }

.security-clear-btn:hover {
  background: rgba(74, 222, 128, 0.1) !important;
  color: var(--success) !important;
}

/* Mobile responsive за security tab */
@media (max-width: 700px) {
  .admin-security-layout {
    flex-direction: column;
  }
  .security-list {
    width: 100%;
    flex: 1;
    border-right: 0;
  }
  .security-detail { width: 100%; }
  .security-detail-placeholder { display: none; }
  .security-detail-active .conv-back { display: flex; }
  .admin-security-layout:has(.security-detail-active:not([hidden])) .security-list { display: none; }
  .admin-security-layout:not(:has(.security-detail-active:not([hidden]))) .security-detail { display: none; }
  .security-map { height: 220px; }
}

.conv-delete-btn {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  flex: 0 0 auto;
  margin-left: 4px;
  transition: all 0.15s;
}
.conv-delete-btn:hover {
  background: rgba(255, 77, 77, 0.1);
  color: var(--danger);
}
.conv-delete-btn:active { transform: scale(0.92); }
.conv-delete-btn svg { width: 18px; height: 18px; }

/* Mobile админ chat — single column с back navigation */
@media (max-width: 700px) {
  .admin-chat-layout {
    flex-direction: column;
  }
  .conv-list {
    width: 100%;
    flex: 1;
    border-right: 0;
  }
  .conv-panel {
    width: 100%;
  }
  /* На mobile placeholder-ът няма смисъл — conv-list е full screen */
  .conv-panel-placeholder { display: none; }
  .conv-panel-active .conv-back { display: flex; }

  /* Когато активен conv е отворен → скрий conv-list, показвай само панела */
  .admin-chat-layout:has(.conv-panel-active:not([hidden])) .conv-list {
    display: none;
  }
  /* Когато НЯМА активен conv → скрий цял конверсация panel-а (за да няма horizontal overflow) */
  .admin-chat-layout:not(:has(.conv-panel-active:not([hidden]))) .conv-panel {
    display: none;
  }
}

