/* Дизайн по river-residence.bg: тъмен топъл фон, бежов акцент, стъклени панели, Poppins. */
:root {
  --bg: #242220;
  --bg-2: #2c2926;
  --text: rgba(255, 255, 255, 0.92);
  --text-2: #d7d7d7;
  --muted: #a39d95;
  --beige: #dbcfbd;
  --beige-ink: #242220;
  --glass: rgba(53, 47, 42, 0.42);
  --glass-2: rgba(68, 54, 44, 0.32);
  --glass-hover: rgba(183, 180, 174, 0.14);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.24);
  --green: #39c747;
  --red: #e15151;
  --amber: #e8b04b;
  --blue: #7fb2e5;
  --radius: 24px;
  --radius-sm: 14px;
  --font: 'Poppins', 'Montserrat', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --tabbar-h: 66px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
/* Топли размазани петна отзад, за да има какво да „пречупва“ стъклото. */
body::before {
  content: ''; position: fixed; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 12% 8%, rgba(219, 207, 189, 0.20), transparent 70%),
    radial-gradient(35% 40% at 92% 18%, rgba(127, 178, 229, 0.10), transparent 70%),
    radial-gradient(45% 40% at 70% 95%, rgba(150, 110, 70, 0.22), transparent 70%),
    radial-gradient(30% 30% at 20% 85%, rgba(104, 96, 86, 0.30), transparent 70%),
    var(--bg);
  filter: blur(10px);
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; }
h1 { font-size: 30px; letter-spacing: -0.01em; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.spacer { flex: 1; }
.pre { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
.icon { flex: none; display: block; }
.empty { color: var(--muted); padding: 10px 0; margin: 0; }
.empty.pad { padding: 18px; }
.count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--glass-2); padding: 1px 8px; border-radius: 999px; margin-left: 6px; }

/* ---------- стъкло ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ---------- рамка ---------- */
.app { min-height: 100vh; }
.topnav {
  position: sticky; top: 12px; z-index: 30; margin: 12px 16px 0;
  display: flex; align-items: center; gap: 18px; padding: 8px 10px 8px 22px; border-radius: 999px;
}
.brand { display: flex; align-items: center; }
.logo { display: block; height: 26px; width: auto; }
.nav-links { display: none; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { padding: 8px 16px; border-radius: 999px; color: var(--text-2); font-size: 15px; transition: background 0.15s; white-space: nowrap; flex: none; }
.nav-links a:hover { background: var(--glass-hover); color: #fff; }
.nav-links a.on { color: #fff; background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1px var(--line); }
.me { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.me-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.topnav .top-cta { display: none; }
.main { padding: 20px 16px calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); max-width: 1440px; margin: 0 auto; }

.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; height: var(--tabbar-h); border-radius: 999px; padding: 6px;
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--muted); font-weight: 500; border-radius: 999px;
}
.tabbar a.on { color: var(--beige-ink); background: var(--beige); }
.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); z-index: 25;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--beige); color: var(--beige-ink); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: grid; place-items: center;
}
@media (min-width: 900px) {
  .topnav { margin: 16px 28px 0; }
  .nav-links, .me { display: flex; }
  .topnav .top-cta { display: inline-flex; }
  .tabbar, .fab { display: none; }
  .main { padding: 28px 28px 56px; }
}
/* Шест раздела на средни екрани: по-плътни връзки, за да не избутат избора на човек и изхода извън екрана. */
@media (min-width: 900px) and (max-width: 1239px) {
  .topnav { gap: 10px; padding-left: 16px; }
  .nav-links a { padding: 8px 11px; font-size: 14px; }
}

/* ---------- основни ---------- */
.card { border-radius: var(--radius); padding: 20px; margin-bottom: 16px; position: relative; }
.card.list { padding: 6px; }
.page { max-width: 1180px; margin: 0 auto; }
.page.wide { max-width: 1440px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 4px 0 0; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); padding: 4px 0 12px; }
.back:hover { color: #fff; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sec-head .sec-title { margin: 0; }
.sec-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--beige); }
.sub-title { margin: 18px 0 8px; font-size: 14px; font-weight: 600; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--beige); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 18px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--glass); color: #fff; font-size: 14px; font-weight: 500;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--glass-hover); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--beige); color: var(--beige-ink); border-color: transparent; }
.btn.primary:hover { background: #e6dccd; }
.btn.white { background: #fff; color: var(--beige-ink); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn.ghost:hover { background: var(--glass-hover); }
.btn.danger { color: #ff8b8b; }
.btn.ok { border-color: rgba(57, 199, 71, 0.5); color: #8fe39a; }
.btn.sm { min-height: 34px; padding: 5px 13px; font-size: 13px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 999px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--glass-hover); color: #fff; }
.icon-btn.sm { width: 28px; height: 28px; }
.link-btn { border: 0; background: none; padding: 0; cursor: pointer; color: var(--beige); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(219, 207, 189, 0.4); }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin: 6px 0; font-size: 14px; }
.alert.error { background: rgba(225, 81, 81, 0.16); color: #ffb0b0; border: 1px solid rgba(225, 81, 81, 0.35); }
.alert.warn { background: rgba(232, 176, 75, 0.14); color: #f3d18f; border: 1px solid rgba(232, 176, 75, 0.35); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.spinner { width: 28px; height: 28px; margin: 40px auto; border: 2px solid var(--line); border-top-color: var(--beige); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.splash { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.splash img { width: 190px; height: auto; animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.6; } }
.narrow { max-width: 420px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 12px; font-weight: 500; color: color-mix(in srgb, var(--c) 70%, #fff);
  background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.badge.dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.m-status { font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--glass-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.m-status.st-done { color: #8fe39a; border-color: rgba(57, 199, 71, 0.35); }
.m-status.st-no_show { color: #ffb0b0; border-color: rgba(225, 81, 81, 0.35); }
.m-status.st-planned { color: var(--beige); border-color: rgba(219, 207, 189, 0.35); }
.avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 15px;
  color: color-mix(in srgb, var(--c) 75%, #fff); background: color-mix(in srgb, var(--c) 18%, rgba(0, 0, 0, 0.2));
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
}
.avatar.big { width: 64px; height: 64px; font-size: 22px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--glass-2); font-size: 13px; font-weight: 500; color: var(--text-2);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip b { color: var(--muted); font-weight: 500; }
.chip:hover { background: var(--glass-hover); }
.chip.on { background: var(--beige); color: var(--beige-ink); border-color: transparent; }
.chip.on b { color: rgba(36, 34, 32, 0.6); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { border-radius: 20px; padding: 16px 18px; position: relative; overflow: hidden; }
.stat[style]::after { content: ''; position: absolute; left: 18px; top: 0; width: 34px; height: 3px; border-radius: 0 0 3px 3px; background: var(--c); }
.stat-value { font-size: 26px; font-weight: 600; line-height: 1.15; }
.stat-label { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.stat-sub { font-size: 12px; color: var(--muted); }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 18px; margin: 14px 0 4px; }
.info-grid div { min-width: 0; }
.info-grid dt { font-size: 12px; color: var(--muted); }
.info-grid dd { margin: 2px 0 0; font-weight: 500; font-size: 15px; }
.info-grid dd.big { font-size: 20px; font-weight: 600; color: var(--beige); }
.loan { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- календар ---------- */
.cal-layout { display: grid; gap: 16px; }
@media (min-width: 1200px) {
  .cal-layout { grid-template-columns: minmax(0, 1.6fr) minmax(400px, 1fr); align-items: start; }
  .day-panel { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow: auto; }
}
.cal-card { padding: 16px; }
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.cal-title { font-size: 26px; text-transform: capitalize; font-weight: 500; }
.cal-title span { color: var(--muted); font-weight: 300; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 500; color: var(--muted); padding: 4px 0; letter-spacing: 0.04em; }
.cal-wd.we { color: var(--beige); }
.cal-day {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 108px; padding: 6px; overflow: hidden;
  border-radius: 14px; cursor: pointer; text-align: left; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  transition: background 0.15s, border-color 0.15s;
}
.cal-day:hover { background: var(--glass-hover); }
.cal-day.outside { opacity: 0.35; }
.cal-day.past .cd-num { color: var(--muted); }
.cal-day.today .cd-num { background: var(--beige); color: var(--beige-ink); }
.cal-day.selected { border-color: var(--beige); box-shadow: inset 0 0 0 1px var(--beige); background: rgba(219, 207, 189, 0.08); }
.cd-num { align-self: flex-start; font-weight: 500; font-size: 13px; min-width: 26px; height: 26px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; }
.cd-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cd-chip {
  display: block; font-size: 11px; line-height: 1.4; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--text-2); border-left: 2px solid var(--c);
}
.cd-chip b { font-weight: 600; color: #fff; }
.cd-chip.st-no_show { opacity: 0.5; text-decoration: line-through; }
.cd-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cd-dots { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
@media (max-width: 699px) {
  .cal-card { padding: 12px 8px; }
  .cal-grid { gap: 3px; }
  .cal-day { min-height: 54px; align-items: center; padding: 4px 2px; border-radius: 10px; }
  .cd-num { align-self: center; }
  .cd-chips { display: none; }
  .cd-dots { display: flex; gap: 3px; justify-content: center; }
  .cd-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
}
.day-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.day-head h2 { font-size: 24px; font-weight: 500; margin-top: 2px; }

/* ---------- срещи ---------- */
.meet-list { display: grid; gap: 10px; }
.meet-card {
  display: flex; gap: 12px; padding: 12px 8px 12px 14px; border-radius: 18px; position: relative;
  background: var(--glass-2); border: 1px solid var(--line); border-left: 3px solid var(--c);
}
.meet-card.st-cancelled, .meet-card.st-no_show { opacity: 0.6; }
.mc-time { flex: none; display: flex; flex-direction: column; min-width: 48px; }
.mc-time b { font-size: 16px; font-weight: 600; }
.mc-date { font-size: 12px; color: var(--muted); }
.mc-main { flex: 1; min-width: 0; }
.mc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mc-client { font-weight: 600; font-size: 16px; }
.mc-client:hover { color: var(--beige); }
.mc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.mc-meta a { display: inline-flex; align-items: center; gap: 4px; }
.mc-meta a:hover { color: #fff; }
.type-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.type-tag i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.mc-offers, .tl-offers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 13px; }
.offer-pill {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); border-radius: 999px; padding: 3px 10px; cursor: pointer; font-size: 12.5px; color: #fff;
}
.offer-pill small { color: var(--muted); }
.offer-pill:hover { border-color: var(--beige); }
.mc-note { margin: 8px 0 0; font-size: 13.5px; color: var(--text-2); }
.mc-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.mc-edit { position: absolute; top: 6px; right: 6px; }
.meet-card .mc-main { padding-right: 34px; }

/* ---------- клиенти ---------- */
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 999px; margin-bottom: 12px; color: var(--muted); }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; min-height: 48px; font-size: 15px; color: #fff; }
.search-box input::placeholder { color: var(--muted); }
.client-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; }
.client-row:hover { background: var(--glass-hover); }
.client-row + .client-row { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.cr-main { flex: 1; min-width: 0; }
.cr-name { font-weight: 500; font-size: 15.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cr-sub { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 2px; }
.cr-sub .strong { color: var(--text-2); }
.next-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: rgba(219, 207, 189, 0.14); color: var(--beige); border: 1px solid rgba(219, 207, 189, 0.3); }
.chev { color: var(--muted); }
@media (max-width: 599px) {
  .next-pill { display: none; }
}

.client-head .ch-top { display: flex; align-items: center; gap: 16px; }
.ch-main { flex: 1; min-width: 0; }
.ch-main h1 { font-size: 26px; }
.ch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 6px; font-size: 14px; color: var(--text-2); }
.ch-meta a { display: inline-flex; align-items: center; gap: 6px; }
.ch-meta a:hover { color: var(--beige); }
.ch-info { margin: 14px 0 0; color: var(--text-2); }
.ch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.client-grid { display: grid; gap: 16px; }
@media (min-width: 1000px) { .client-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.col { min-width: 0; }

.apt-hero {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05);
}
.apt-hero:hover { border-color: var(--beige); }
.ah-code { flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 18px; font-weight: 600; background: var(--beige); color: var(--beige-ink); }
.ah-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ah-main b { font-size: 17px; font-weight: 600; }
.ah-main .muted { font-size: 13px; }
.schedule { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: rgba(0, 0, 0, 0.18); border: 1px solid rgba(255, 255, 255, 0.06); }
.sch-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.sch-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.sch-row + .sch-row { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.sch-pct { flex: none; width: 46px; color: var(--beige); font-weight: 600; }
.sch-label { flex: 1; color: var(--text-2); }

.extra-list, .doc-list, .offer-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.extra-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 12px; padding: 8px 4px 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.extra-row.total { background: transparent; border-top: 1px solid var(--line); border-radius: 0; color: var(--beige); padding-top: 10px; }
.ex-name b { color: var(--beige); }
.doc-row { display: flex; align-items: center; gap: 6px; }
.doc-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px 10px; border-radius: 14px; border: 0; background: rgba(255, 255, 255, 0.04); cursor: pointer; }
.doc-open:hover { background: var(--glass-hover); }
.doc-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); color: var(--text-2); }
.doc-ico.k-contract { color: var(--beige); background: rgba(219, 207, 189, 0.14); }
.doc-ico.k-invoice { color: var(--blue); background: rgba(127, 178, 229, 0.14); }
.doc-main { min-width: 0; display: flex; flex-direction: column; }
.doc-main b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.04); cursor: pointer; text-align: left; }
.offer-row:hover { border-color: var(--line-strong); }
.offer-row b { font-weight: 500; }
.offer-row .right { text-align: right; }

.note-form { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 14px; }
.note-form textarea { flex: 1; min-height: 46px; resize: vertical; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.2); outline: none; font-size: 14px; }
.note-form textarea:focus { border-color: var(--beige); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 90px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { display: grid; grid-template-columns: 76px 1fr; gap: 20px; padding: 8px 0; }
.tl-date { font-size: 12px; color: var(--muted); padding-top: 2px; text-align: right; }
.tl-body { min-width: 0; position: relative; }
.tl-dot { position: absolute; left: -10px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--beige)); box-shadow: 0 0 0 3px var(--bg); }
.tl-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 500; }
.tl-title.strong { font-weight: 600; color: #fff; }
.tl-text { margin: 4px 0 0; font-size: 13.5px; color: var(--text-2); }

/* ---------- апартаменти ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.buildings { display: grid; gap: 16px; }
@media (min-width: 1100px) { .buildings { grid-template-columns: 1fr 1fr; align-items: start; } }
.bld-title { font-size: 18px; font-weight: 500; margin-bottom: 12px; }
.floors { display: grid; gap: 6px; }
.floor-row { display: flex; align-items: stretch; gap: 8px; }
.floor-label { flex: none; width: 44px; font-size: 12px; color: var(--muted); display: grid; place-items: center; }
.floor-apts { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.apt-tile {
  display: flex; flex-direction: column; gap: 1px; min-width: 0; text-align: left; cursor: pointer; padding: 8px 10px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 10%, rgba(255, 255, 255, 0.03));
  transition: transform 0.12s, background 0.15s, opacity 0.15s;
}
.apt-tile:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--c) 20%, rgba(255, 255, 255, 0.04)); }
.apt-tile.dim { opacity: 0.18; }
.at-top { display: flex; align-items: center; justify-content: space-between; }
.at-top b { font-size: 14px; font-weight: 600; }
.at-top i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.at-line { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-foot { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) {
  .floor-apts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .floor-label { width: 30px; }
}
.apt-panel .ap-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.buyer-link {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 16px; cursor: pointer; text-align: left;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05);
}
.buyer-link > span:first-child { display: flex; flex-direction: column; flex: 1; }
.buyer-link b { font-size: 16px; font-weight: 600; }
.buyer-link:hover { border-color: var(--beige); }

/* ---------- продажби ---------- */
.sales-grid { display: grid; gap: 16px; }
@media (min-width: 1000px) { .sales-grid { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.model-bars { display: grid; gap: 10px; margin-bottom: 10px; }
.mb-row { display: grid; grid-template-columns: minmax(130px, 1.2fr) 2fr auto; gap: 12px; align-items: center; }
.mb-label { display: flex; flex-direction: column; min-width: 0; }
.mb-label b { font-weight: 500; font-size: 14px; }
.mb-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.mb-bar span { display: block; height: 100%; border-radius: 999px; background: var(--beige); }
.mb-val { display: flex; flex-direction: column; align-items: flex-end; min-width: 90px; }
.mb-val b { font-size: 16px; }
.extra-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.et { padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 6px; }
.et b { font-size: 24px; font-weight: 600; }
.et span { font-size: 13px; color: var(--muted); }
.et small { grid-column: 1 / -1; font-size: 13px; color: var(--text-2); }
.et-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); margin-top: 8px; overflow: hidden; }
.et-bar span { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.table-wrap { overflow-x: auto; margin: 0 -8px; }
.sales-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 820px; }
.sales-table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.sales-table td { padding: 10px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); vertical-align: middle; }
.sales-table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.sales-table .num { text-align: right; }
.sales-table .c { text-align: center; }
.sales-table a:hover { color: var(--beige); }
.yes { color: var(--green); font-weight: 600; }
.no { color: rgba(255, 255, 255, 0.25); }

/* ---------- форми ---------- */
.overlay {
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 13, 12, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade 0.15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden;
  border-radius: 28px; background: rgba(44, 40, 36, 0.82); -webkit-backdrop-filter: blur(40px) saturate(150%); backdrop-filter: blur(40px) saturate(150%);
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 20px; font-weight: 500; }
.modal-body { padding: 18px 24px 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 699px) {
  .overlay { padding: 0; align-items: stretch; }
  .modal, .modal.wide { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .modal-head { padding-top: max(14px, env(safe-area-inset-top)); }
  .modal-body { padding: 16px 16px 0; }
}
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea, .offer-edit input, .offer-edit select {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22); font-size: 15px; outline: none; color: #fff;
}
.field select option, .offer-edit select option { background: #2c2926; }
.field textarea { resize: vertical; min-height: 70px; }
.field input:focus, .field select:focus, .field textarea:focus, .offer-edit input:focus, .offer-edit select:focus { border-color: var(--beige); box-shadow: 0 0 0 3px rgba(219, 207, 189, 0.18); }
.field input[type='date']::-webkit-calendar-picker-indicator, .field input[type='time']::-webkit-calendar-picker-indicator { filter: invert(0.85); }
.hint { font-size: 12px; color: var(--muted); }
.readonly { min-height: 46px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); color: var(--muted); }
.grid2, .grid3 { display: grid; gap: 14px; }
@media (min-width: 560px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr 1fr; }
}
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented button {
  min-height: 40px; padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 500;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text-2);
}
.segmented button:hover { background: var(--glass-hover); }
.segmented button.on { background: var(--beige); color: var(--beige-ink); border-color: transparent; }
.segmented button[style].on { background: var(--c); color: #1b1917; }
.form-foot {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 4px -24px 0; padding: 14px 24px; padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: rgba(44, 40, 36, 0.92); border-top: 1px solid var(--line);
}
.apt-panel .form-foot { margin-top: 18px; }
@media (max-width: 699px) { .form-foot { margin: 4px -16px 0; padding-left: 16px; padding-right: 16px; } }

.client-picker { display: grid; gap: 8px; justify-items: start; }
.client-picker .search-box { width: 100%; margin: 0; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.22); }
.client-picker .search-box input { min-height: 44px; }
.pick-list { width: 100%; display: grid; gap: 4px; }
.pick-row, .picked { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 14px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.05); cursor: pointer; text-align: left; }
.pick-row:hover { border-color: var(--line-strong); }
.picked { cursor: default; border-color: rgba(219, 207, 189, 0.35); }
.pk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pk-main b { font-weight: 500; }
.pick-row .avatar, .picked .avatar { width: 36px; height: 36px; font-size: 13px; }
.new-client { display: grid; gap: 10px; justify-items: start; }
.new-client .grid2 { width: 100%; }
.offer-edit { display: grid; grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr) minmax(0, 1.4fr) auto; gap: 6px; align-items: center; margin-bottom: 6px; }
@media (max-width: 599px) { .offer-edit { grid-template-columns: 1fr 1fr auto; } .offer-edit select:first-child { grid-column: 1 / -1; } }
.add-offer { align-self: flex-start; }
.price-box { display: grid; gap: 6px; padding: 14px 16px; border-radius: 18px; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.06); }
.price-box div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.price-box span { color: var(--muted); }
.price-box .final { border-top: 1px solid var(--line); padding-top: 8px; font-size: 16px; }
.price-box .final b { color: var(--beige); font-size: 20px; }
.price-box .sch { font-size: 13px; }
.drop {
  display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: 18px; cursor: pointer;
  border: 1.5px dashed var(--line-strong); background: rgba(255, 255, 255, 0.03); color: var(--text-2);
}
.drop:hover { border-color: var(--beige); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ---------- съобщения ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 90px + env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
@media (min-width: 900px) { .toasts { bottom: 28px; } }
.toast { padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; animation: rise 0.2s ease-out; background: rgba(44, 40, 36, 0.9); }
.toast.error { border-color: rgba(225, 81, 81, 0.5); color: #ffb0b0; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.demo-banner { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 70; background: var(--beige); color: var(--beige-ink); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; padding: 2px 14px; border-radius: 0 0 10px 10px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 599px) {
  .client-head .ch-top { align-items: flex-start; gap: 12px; }
  .avatar.big { width: 48px; height: 48px; font-size: 17px; }
  .ch-main h1 { font-size: 22px; }
  .timeline::before { left: 74px; }
  .tl-item { grid-template-columns: 60px 1fr; }
}
@media (max-width: 599px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 12px 14px; border-radius: 16px; }
  .stat-value { font-size: 20px; }
  h1 { font-size: 26px; }
}

/* ---------- истински данни от Odoo ---------- */
.stage { font-size: 11.5px; font-weight: 500; padding: 1px 9px; border-radius: 999px; color: var(--text-2); border: 1px dashed var(--line-strong); white-space: nowrap; }
.src { font-size: 11px; color: var(--muted); padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); white-space: nowrap; font-weight: 400; }
.warn-text { color: var(--amber); font-weight: 500; }
.stage-to { color: var(--text); font-weight: 600; }
.me select { background: transparent; border: 0; color: var(--text-2); font-size: 14px; cursor: pointer; outline: none; padding: 4px 0; max-width: 150px; }
.me select option { background: #2c2926; }
.sync:disabled { opacity: 0.6; }
.sync.spin svg { animation: spin 0.9s linear infinite; }
.demo-banner.live { background: rgba(57, 199, 71, 0.9); color: #10240f; }
.bld-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.bld-head .bld-title { margin: 0; }
.bld-count { display: flex; gap: 12px; font-size: 13px; color: var(--text-2); }
.bld-count span { display: inline-flex; align-items: center; gap: 5px; }
.bld-count i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.apt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.ch-info { margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.18); }
.ch-info p { margin: 2px 0 0; color: var(--text-2); }
.order-list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.order { padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid transparent; }
.order.st-cancel { opacity: 0.55; }
.or-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.or-lines { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.offer-pill.plain { cursor: default; color: var(--text-2); }
.offer-pill.plain:hover { border-color: var(--line); }
.offer-row:disabled { cursor: default; }
.mb-row.none .mb-bar span { background: var(--amber); }
.model-pick { display: grid; gap: 6px; }
.model-pick button {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text);
}
.model-pick button:hover { background: var(--glass-hover); }
.model-pick i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.model-pick button.on { border-color: var(--beige); background: rgba(219, 207, 189, 0.1); }
.model-pick button.on i { border: 5px solid var(--beige); background: var(--beige-ink); }
.model-pick b { color: var(--beige); font-weight: 600; }
@media (max-width: 899px) { .me { display: none; } }

/* ---------- филтри по сграда ---------- */
.bld-head { margin-bottom: 8px; }
.bld-count button {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; background: none; color: var(--text-2); font-size: 13px;
}
.bld-count button:hover { background: var(--glass-hover); }
.bld-count button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); color: #fff; }
.bld-count i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.bld-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mini-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text-2); font-size: 12.5px; font-weight: 500;
}
.mini-chip b { color: var(--muted); font-weight: 500; }
.mini-chip:hover { background: var(--glass-hover); }
.mini-chip.on { background: var(--beige); color: var(--beige-ink); border-color: transparent; }
.mini-chip.on b { color: rgba(36, 34, 32, 0.6); }
.mini-chip.clear { border-style: dashed; color: var(--muted); }
/* Неизбраните апартаменти потъмняват почти до черно. */
.apt-tile.dim { opacity: 1; background: rgba(0, 0, 0, 0.45); border-color: rgba(255, 255, 255, 0.04); transform: none; }
.apt-tile.dim > * { opacity: 0.18; }
.apt-tile.dim .at-top i { background: var(--muted); }
.floor-apts { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.floor-label { width: 52px; }

/* ---------- ВИП (етажи 10 и 11) ---------- */
.vip-block {
  margin-bottom: 14px; padding: 10px 10px 12px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(219, 207, 189, 0.16), rgba(219, 207, 189, 0.04));
  border: 1px solid rgba(219, 207, 189, 0.35);
}
.vip-head { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--beige); margin: 0 0 8px 4px; }
.vip-head span { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: 6px; }
.mini-chip.vip { border-color: rgba(219, 207, 189, 0.45); color: var(--beige); }
.mini-chip.vip.on { color: var(--beige-ink); }
.vip-tag { font-size: 12px; font-weight: 600; color: var(--beige); padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(219, 207, 189, 0.45); }

/* ---------- не се продава (обезщетения) ---------- */
.apt-tile.st-nfs {
  border-style: dashed; border-color: rgba(255, 255, 255, 0.18);
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 6px, rgba(0, 0, 0, 0.18) 6px 12px);
}
.apt-tile.st-nfs .at-top b, .apt-tile.st-nfs .at-line { color: var(--muted); }
.apt-tile.st-nfs .at-foot { color: var(--muted); font-style: italic; }
.apt-tile.st-nfs:hover { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 6px, rgba(0, 0, 0, 0.12) 6px 12px); }

/* ---------- гаражи и паркоместа ---------- */
.units-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); margin-bottom: 14px; }
.units-switch a { padding: 7px 16px; border-radius: 999px; font-size: 14px; color: var(--text-2); }
.units-switch a.on { background: var(--beige); color: var(--beige-ink); font-weight: 500; }
.park-sec + .park-sec { margin-top: 14px; }
.park-title { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--beige); margin: 0 0 8px 2px; }
.park-title span { color: var(--muted); font-weight: 400; margin-left: 4px; }
.apt-tile.park .at-top b { font-size: 13px; }

/* ---------- схема на паркоместата ---------- */
.plan-card { margin-top: 16px; }
.plan-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.zoom { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); }
.zoom button { border: 0; background: none; color: var(--text-2); font-size: 12px; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.zoom button.on { background: var(--beige); color: var(--beige-ink); }
.plan-wrap { overflow: auto; border-radius: 16px; background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.06); max-height: 78vh; }
.plan { display: block; }
.plan .street { stroke: rgba(255, 255, 255, 0.25); stroke-width: 6; stroke-dasharray: 40 24; }
.plan .street-label { fill: var(--muted); font-size: 34px; text-anchor: middle; font-family: var(--font); }
.plan .bld rect { fill: rgba(219, 207, 189, 0.12); stroke: rgba(219, 207, 189, 0.55); stroke-width: 3; }
.plan .bld text { fill: var(--beige); font-size: 40px; font-weight: 600; text-anchor: middle; font-family: var(--font); }
.plan .bld.later rect { fill: rgba(255, 255, 255, 0.03); stroke: rgba(255, 255, 255, 0.2); stroke-dasharray: 14 10; }
.plan .bld.later text { fill: var(--muted); font-size: 30px; font-weight: 400; }
.plan .spot rect { stroke-width: 2.5; }
.plan .spot text { fill: #fff; font-size: 19px; font-weight: 600; text-anchor: middle; font-family: var(--font); pointer-events: none; }
.plan .spot.st-none rect { stroke-dasharray: 6 5; }
.plan .spot.st-none text { fill: var(--muted); }
.plan .spot.click { cursor: pointer; }
.plan .spot.click:hover rect { stroke: #fff; stroke-width: 4; }
.plan .spot.faded { opacity: 0.15; }
.legend i.outline { background: none; border: 1.5px dashed rgba(255, 255, 255, 0.4); }
.plan-wrap.fit { max-height: none; overflow: hidden; }

/* ---------- вход ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; border-radius: 28px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 4px; }
.login-logo .logo-full { width: 170px; height: auto; }
.login-card h1 { font-size: 24px; text-align: center; }
.btn.block { width: 100%; }
.link-btn.center { align-self: center; font-size: 13px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---------- телефон: долното меню и инструментите на схемата ---------- */
.tabbar a { min-width: 0; }
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-card .sec-head { align-items: flex-start; }
.plan-tools { min-width: 0; max-width: 100%; }
.plan-tools .chips { max-width: 100%; }
@media (max-width: 699px) {
  .plan-card .sec-head { flex-direction: column; align-items: stretch; }
  .plan-tools { flex-direction: column; align-items: stretch; gap: 8px; }
  .plan-tools .zoom { align-self: flex-start; }
  .plan-wrap { max-height: 70vh; }
}

/* ---------- приходи (паричните потоци) ---------- */
.cf-filter { flex-wrap: wrap; margin-bottom: 16px; }
.cf-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cf-stage { border-radius: 20px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cf-stage-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-bottom: 2px; }
.cf-stage-head i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.cf-stage b { font-size: 20px; font-weight: 600; line-height: 1.25; }
.cf-stage small { font-size: 12px; color: var(--muted); }
.cf-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); margin-top: 8px; overflow: hidden; }
.cf-bar span { display: block; height: 100%; border-radius: 999px; background: var(--c); }
.cf-grid { display: grid; gap: 16px; }
@media (min-width: 1000px) { .cf-grid { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.cf-extras .et { grid-template-columns: 1fr; }
.cf-extras .et b { font-size: 20px; }
.pie-wrap { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: center; }
.pie-box { position: relative; flex: 0 1 220px; max-width: 220px; }
.pie-box svg { display: block; width: 100%; height: auto; overflow: visible; }
.pie-slice { cursor: pointer; stroke: #2c2926; stroke-width: 2; stroke-linejoin: round; outline: none; transition: transform 0.15s ease; }
.pie-slice.on { transform: translate(var(--dx), var(--dy)); }
.pie-slice:focus-visible { stroke: #fff; }
.pie-label { font: 600 13px var(--font); fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, 0.35); stroke-width: 3px; pointer-events: none; }
.pie-tip {
  position: absolute; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none; z-index: 2; white-space: nowrap;
  padding: 8px 12px; border-radius: 12px; background: rgba(28, 26, 24, 0.95); border: 1px solid var(--line); font-size: 13px;
}
.pie-tip b { display: block; font-size: 15px; font-weight: 600; }
.pie-tip span { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.pie-tip span i { width: 12px; height: 2px; border-radius: 2px; background: var(--c); }
.legend { display: flex; flex-direction: column; gap: 2px; flex: 1 1 270px; min-width: 0; max-width: 460px; }
.legend-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 40px; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; font-size: 14px; }
.legend-row.on { background: var(--glass-hover); }
.legend-row i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.legend-row b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend-row small { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.cf-table { min-width: 560px; }
.cf-actions { text-align: right; white-space: nowrap; }
.icon-btn.danger:hover { color: #ff8b8b; }
/* Шест раздела в долното меню на тесен телефон: по-малко поле и шрифт, за да се побере „Продажби“. */
@media (max-width: 420px) {
  .tabbar { left: 8px; right: 8px; padding: 5px; }
  .tabbar a { font-size: 10px; letter-spacing: -0.01em; }
}
