:root {
  --bg: #050A07;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.07);
  --edge: rgba(255, 255, 255, 0.09);
  --edge-hi: rgba(168, 240, 204, 0.22);
  --line: rgba(255, 255, 255, 0.08);
  --text: #F2F6F3;
  --text-2: #B9CABF;
  --muted: #7F978A;
  --accent: #38A673;
  --accent-deep: #1E7A52;
  --mint: #A8F0CC;
  --track: rgba(255, 255, 255, 0.07);
  --warn: #E0A84B;
  --radius: 24px;
  --ease: cubic-bezier(.22, .8, .2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); -webkit-font-smoothing: antialiased; min-height: 100vh; position: relative; overflow-x: hidden; }
a { color: inherit; }

/* ---------- Живой фон: мягкие пятна света ---------- */
.orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; will-change: transform; }
.o1 { width: 620px; height: 620px; left: -160px; top: -200px; background: radial-gradient(circle, #1E7A52 0%, transparent 70%); animation: drift1 26s ease-in-out infinite alternate; }
.o2 { width: 520px; height: 520px; right: -140px; top: 220px; background: radial-gradient(circle, #0F5C46 0%, transparent 70%); animation: drift2 32s ease-in-out infinite alternate; }
.o3 { width: 460px; height: 460px; left: 30%; bottom: -220px; background: radial-gradient(circle, #2E8C61 0%, transparent 70%); opacity: .35; animation: drift3 38s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(140px, 90px) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-120px, 140px) scale(.92); } }
@keyframes drift3 { to { transform: translate(-160px, -80px) scale(1.15); } }

/* ---------- Шапка ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 32px; position: sticky; top: 0; z-index: 5;
  background: rgba(5, 10, 7, 0.55); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark { width: 30px; height: 30px; border-radius: 9px; display: inline-block;
  background: conic-gradient(from 210deg, var(--mint), var(--accent), var(--accent-deep), var(--mint));
  box-shadow: 0 0 18px rgba(56, 166, 115, .45), inset 0 0 0 7px #0B140F; }
.mark.big { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 0 30px rgba(56, 166, 115, .5), inset 0 0 0 12px #0B140F; }
.brand-title { font-weight: 650; font-size: 17px; letter-spacing: -0.01em; }
.brand-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip { font-size: 13px; color: var(--text-2); background: var(--glass); border: 1px solid var(--edge);
  padding: 7px 13px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; }
.chip b { color: var(--text); font-weight: 600; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(168, 240, 204, .55); } 70% { box-shadow: 0 0 0 9px rgba(168, 240, 204, 0); } 100% { box-shadow: 0 0 0 0 rgba(168, 240, 204, 0); } }
.logout { font-size: 13px; color: var(--muted); text-decoration: none; padding: 7px 10px; border-radius: 10px; transition: color .2s, background .2s; }
.logout:hover, .logout:focus-visible { color: var(--text); background: var(--glass-2); outline: none; }

/* ---------- Сетка ---------- */
.board { max-width: 1240px; margin: 0 auto; padding: 26px 32px 40px;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.hero { grid-column: span 8; }
.live { grid-column: span 4; }
.ring-card, .third { grid-column: span 4; }
.wide { grid-column: span 12; }

/* ---------- Стеклянные карточки ---------- */
.card {
  position: relative; border-radius: var(--radius); padding: 22px 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025) 60%);
  border: 1px solid var(--edge);
  backdrop-filter: blur(22px) saturate(130%); -webkit-backdrop-filter: blur(22px) saturate(130%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 24px 60px -30px rgba(0, 0, 0, .8);
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
  overflow: hidden;
}
.card:hover { transform: translateY(-2px); border-color: var(--edge-hi);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 30px 70px -30px rgba(0, 0, 0, .9), 0 0 40px -12px rgba(56, 166, 115, .35); }
.reveal { animation: rise .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.005em; }
.muted { color: var(--muted); font-size: 13px; }
.count { color: var(--text); font-size: 13px; font-weight: 600; background: var(--glass-2); border: 1px solid var(--edge);
  border-radius: 999px; padding: 2px 10px; }
.empty { color: var(--muted); font-size: 14px; margin: 6px 0; }
.warn { color: var(--warn); font-size: 13px; margin-top: 10px; }
.delta { font-size: 13px; font-weight: 600; }
.delta.up { color: var(--text); }
.delta.up::before { content: "▲ "; color: var(--mint); font-size: 10px; }

/* ---------- Главная карточка с фото ---------- */
.hero { padding: 0; min-height: 380px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(120deg, rgba(14, 40, 28, .92) 0%, rgba(10, 26, 18, .75) 45%, rgba(10, 26, 18, .2) 100%); }
.hero-top { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 24px; padding: 24px 28px 0; }
.arch { position: relative; margin: 0; flex: none; width: 230px; height: 268px; border-radius: 115px 115px 20px 20px; overflow: hidden;
  border: 1px solid rgba(168, 240, 204, .22); box-shadow: 0 0 0 6px rgba(255, 255, 255, .025), 0 30px 60px -20px rgba(0, 0, 0, .8), 0 0 60px -10px rgba(56, 166, 115, .35);
  animation: photo 1.6s var(--ease) both; }
.arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; display: block; filter: saturate(.92) contrast(1.04);
  transition: transform 1.2s var(--ease); }
.card:hover .arch img { transform: scale(1.04); }
.arch figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 12px; font-size: 12px; letter-spacing: .04em; color: var(--text);
  background: linear-gradient(to top, rgba(5, 12, 8, .85), transparent); }
@keyframes photo { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(70% 90% at 82% 30%, rgba(56, 166, 115, .22), transparent 70%); }
.hero-body { position: relative; z-index: 1; flex: 1; min-width: 0; }
.eyebrow { display: inline-block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--mint);
  background: rgba(56, 166, 115, .14); border: 1px solid rgba(168, 240, 204, .2); padding: 5px 10px; border-radius: 999px; }
.hero-title { color: var(--text-2); font-size: 15px; margin-top: 18px; }
.hero-row { display: flex; align-items: baseline; gap: 12px; margin-top: 2px; flex-wrap: wrap; }
.hero-value { font-size: 84px; font-weight: 700; letter-spacing: -0.045em; line-height: 1;
  background: linear-gradient(180deg, #FFFFFF 30%, var(--mint) 140%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-of { color: var(--text-2); font-size: 22px; }
.meter { height: 10px; border-radius: 999px; background: var(--track); margin-top: 18px; overflow: hidden; display: flex; gap: 2px; max-width: 420px; }
.meter-fill { display: block; height: 100%; width: var(--w); min-width: 8px; background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  animation: grow 1.4s var(--ease) .3s both; transform-origin: left; }
.meter-fill:first-child { border-radius: 999px 0 0 999px; }
.meter-fill:last-child { border-radius: 0 4px 4px 0; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hatch, .meter-fill.hatch { background: repeating-linear-gradient(135deg, var(--accent) 0 2px, #0E2A1D 2px 4px); }
.meter-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); font-size: 12px; margin-top: 10px; align-items: center; max-width: 420px; }
.meter-legend .right { margin-left: auto; color: var(--muted); }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--accent); margin-right: 6px; vertical-align: -2px; }

.hero-stats { position: relative; z-index: 1; margin: 20px 16px 16px; display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(10, 22, 16, .45); border: 1px solid rgba(255, 255, 255, .1); border-radius: 18px;
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); }
.hs { padding: 14px 18px; position: relative; }
.hs + .hs::before { content: ""; position: absolute; left: 0; top: 18%; height: 64%; width: 1px; background: rgba(255, 255, 255, .1); }
.hs b { display: block; font-size: 28px; font-weight: 650; letter-spacing: -0.02em; }
.hs span { display: block; color: var(--text-2); font-size: 12px; margin-top: 2px; line-height: 1.3; }

/* ---------- Плавные графики ---------- */
.live .big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.live .big > span { font-size: 44px; font-weight: 700; letter-spacing: -0.03em; }
.live .big small { color: var(--text-2); font-size: 13px; }
.live-dot { font-size: 12px; color: var(--mint); display: inline-flex; align-items: center; gap: 6px; }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); animation: pulse 2.4s infinite; }
.lc { position: relative; margin-top: 8px; }
.line-chart { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.line-chart .grid { stroke: rgba(255, 255, 255, .06); stroke-width: 1; stroke-dasharray: 2 4; }
.line-chart .ytick { fill: var(--muted); font-size: 11px; text-anchor: end; font-variant-numeric: tabular-nums; }
.line-chart .xtick { fill: var(--muted); font-size: 11px; text-anchor: middle; font-variant-numeric: tabular-nums; }
.line-chart .line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(56, 166, 115, .55)); }
.line-chart .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s var(--ease) .35s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.line-chart .area { opacity: 0; animation: fade 1.2s ease 1.1s forwards; }
@keyframes fade { to { opacity: 1; } }
.line-chart .last { fill: var(--mint); stroke: #0B140F; stroke-width: 2; opacity: 0; animation: fade .4s ease 2s forwards; }
.line-chart .last-halo { fill: rgba(168, 240, 204, .3); opacity: 0; transform-box: fill-box; transform-origin: center; animation: halo 2.4s ease-out 2.2s infinite; }
@keyframes halo { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.2); opacity: 0; } }
.line-chart .cross { stroke: rgba(255, 255, 255, .25); stroke-width: 1; opacity: 0; transition: opacity .15s; }
.line-chart .focus { fill: var(--mint); stroke: #0B140F; stroke-width: 2; opacity: 0; transition: opacity .15s; }
.lc.hover .cross, .lc.hover .focus { opacity: 1; }
.tip { position: absolute; left: 0; top: 0; pointer-events: none; opacity: 0; transform: translate(-50%, -130%); white-space: nowrap;
  background: rgba(12, 24, 18, .92); border: 1px solid var(--edge-hi); color: var(--text); font-size: 12px;
  padding: 6px 10px; border-radius: 10px; transition: opacity .15s; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .8); }
.tip b { font-weight: 650; }
.tip span { color: var(--text-2); }
.lc.hover .tip { opacity: 1; }

/* ---------- Кольца ---------- */
.ring-wrap { position: relative; width: 168px; height: 168px; margin: 4px auto 0; }
.ring-wrap.sm { width: 150px; height: 150px; margin: 0; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring .track { fill: none; stroke: var(--track); stroke-width: 12; }
.ring .val { fill: none; stroke-width: 12; stroke-linecap: round;
  stroke-dasharray: var(--len) var(--c); stroke-dashoffset: var(--len);
  filter: drop-shadow(0 0 8px rgba(56, 166, 115, .45));
  animation: ring 1.6s var(--ease) .4s forwards; }
.ring .seg { stroke-linecap: butt; transform: rotate(var(--rot)); transform-origin: 70px 70px; animation-delay: calc(.4s + var(--d)); filter: none; }
@keyframes ring { to { stroke-dashoffset: 0; } }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-center b { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.ring-center > span { color: var(--text-2); font-size: 12px; margin-top: 4px; line-height: 1.25; }
.ring-foot { display: flex; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.ring-foot b { color: var(--text); }

.donut-row { display: flex; align-items: center; gap: 20px; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: 8px; font-size: 13px; color: var(--text-2); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend li b { margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend li.zero { opacity: .45; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.s0 { stroke: #C9F7DF; } .sw.s0 { background: #C9F7DF; }
.s1 { stroke: #7FDDAF; } .sw.s1 { background: #7FDDAF; }
.s2 { stroke: #38A673; } .sw.s2 { background: #38A673; }
.s3 { stroke: #1F6E4B; } .sw.s3 { background: #1F6E4B; }
.s4 { stroke: #55635B; } .sw.s4 { background: #55635B; }
.s5 { stroke: #2F3833; } .sw.s5 { background: #2F3833; }

/* ---------- Люди ---------- */
.person { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.card-head + .person { border-top: 0; }
.ava { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 14px; font-weight: 650;
  color: #0B140F; background: linear-gradient(140deg, #9FB3A8, #5E7468); }
.ava.hot { background: linear-gradient(140deg, var(--mint), var(--accent)); box-shadow: 0 0 16px -2px rgba(56, 166, 115, .6); }
.ava.wait { background: linear-gradient(140deg, #7F978A, #4B5C53); color: #F2F6F3; }
.ava.urgent { background: linear-gradient(140deg, #F2C879, var(--warn)); }
.pname { font-size: 15px; font-weight: 550; margin-top: 1px; }
.pgoal { color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.35; }

/* ---------- Цитаты ---------- */
.qgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
blockquote { margin: 0; padding: 18px; border-radius: 18px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
blockquote p { margin: 0; font-size: 15px; line-height: 1.5; }
.qn { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 650; font-size: 13px;
  color: #0B140F; background: linear-gradient(140deg, var(--mint), var(--accent)); }
.qc { color: var(--muted); font-size: 13px; margin-top: auto; }

.foot { grid-column: span 12; color: var(--muted); font-size: 12px; margin-top: 8px; text-align: center; }

/* ---------- Вход ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-box { text-align: center; max-width: 380px; padding: 44px 28px; border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)); border: 1px solid var(--edge);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); margin: 24px; }
.login-box h1 { font-size: 26px; margin: 18px 0 8px; }
.login-box .muted { margin-bottom: 24px; display: block; }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .hero, .live { grid-column: span 12; }
  .ring-card, .third { grid-column: span 6; }
  .qgrid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .board { padding: 16px 14px 32px; gap: 14px; }
  .top { padding: 14px 16px; position: static; }
  .ring-card, .third { grid-column: span 12; }
  .hero { min-height: 0; }
  .hero-top { flex-direction: column-reverse; align-items: center; padding: 22px 20px 0; gap: 18px; }
  .hero-body { width: 100%; }
  .arch { width: 210px; height: 246px; }
  .hero-value { font-size: 68px; }
  .hero-stats { grid-template-columns: 1fr 1fr; margin: 18px 12px 12px; }
  .hs:nth-child(3)::before { display: none; }
  .hs:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .1); }
  .donut-row { flex-direction: column; align-items: stretch; }
  .ring-wrap.sm { margin: 0 auto; }
  .card { padding: 18px; }
  .hero { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .line-chart .draw { stroke-dashoffset: 0; }
  .line-chart .area, .line-chart .last { opacity: 1; }
  .ring .val { stroke-dashoffset: 0; }
}
