/* «Апорт Городок» — дашборд руководства. Liquid glass по макету: тёмно-синий фон, цветные размытые пятна,
   стеклянные карточки. Mobile-first: одна колонка, с 760 px — сетка как в макете монитора. */
:root {
  --bg: #0B1530;
  --text: #F4F6FB;
  --muted: rgba(244, 246, 251, 0.82);
  --faint: rgba(244, 246, 251, 0.7);
  --glass: rgba(255, 255, 255, 0.12);
  --glass-line: rgba(255, 255, 255, 0.28);
  --orange: #E8833A;
  --orange-text: #FFE7D4;
  --blue: #2E7DD7;
  --teal: #1FA39A;
  --day: rgba(232, 131, 58, 0.85);
  --night: rgba(46, 125, 215, 0.75);
  --radius: 28px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--bg);
  font: 15px/1.4 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
p, h1, h2 { margin: 0; }

/* фон: пятна неподвижны, карточки едут поверх — стекло видно при прокрутке */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; }
.b1 { left: -120px; top: -80px; width: 420px; height: 420px; background: var(--orange); opacity: .55; filter: blur(70px); }
.b2 { right: -140px; top: 40vh; width: 380px; height: 380px; background: var(--blue); opacity: .55; filter: blur(80px); }
.b3 { left: -100px; bottom: -120px; width: 360px; height: 360px; background: var(--teal); opacity: .45; filter: blur(80px); }

.page {
  position: relative; z-index: 1; max-width: 1360px; margin: 0 auto;
  padding: max(40px, env(safe-area-inset-top)) 20px 40px; display: flex; flex-direction: column; gap: 16px;
}

/* шапка */
header { display: flex; flex-direction: column; gap: 6px; padding: 0 4px 8px; }
.when { font-size: 15px; font-weight: 500; color: rgba(244, 246, 251, .78); }
h1 { font-size: 32px; font-weight: 700; letter-spacing: -.5px; }
.pill {
  align-self: flex-start; margin-top: 6px; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  background: rgba(31, 163, 154, .28); border: 1px solid rgba(160, 240, 230, .45); color: #D8FFF8;
}
.pill.warn { background: rgba(232, 131, 58, .32); border-color: rgba(255, 200, 160, .6); color: var(--orange-text); }
.pill.demo { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); color: #fff; }

/* карточки */
.card {
  border-radius: var(--radius); padding: 22px; background: var(--glass); border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 12px 32px rgba(0, 0, 0, .22);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  min-width: 0;
}
.card.quiet { background: rgba(255, 255, 255, .10); border-color: rgba(255, 255, 255, .24); }
.label { font-size: 15px; font-weight: 600; color: var(--muted); }
.big { margin-top: 4px; font-size: 64px; font-weight: 700; letter-spacing: -2px; line-height: 1; }
.mid { margin-top: 6px; font-size: 28px; font-weight: 700; line-height: 1.15; }
.sub { margin-top: 10px; font-size: 14px; color: var(--muted); }
.sub b { color: #fff; }
.note { margin-top: 12px; font-size: 13px; line-height: 1.45; color: var(--muted); }

.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g2 .label { font-size: 13px; }
.g2 .sub { font-size: 13px; margin-top: 4px; }
.wide-only { display: none; }

/* главная оранжевая карточка */
.hero {
  border-radius: var(--radius); padding: 24px; background: rgba(232, 131, 58, .30);
  border: 1px solid rgba(255, 200, 160, .55); color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 230, 210, .5), 0 12px 32px rgba(0, 0, 0, .25);
  backdrop-filter: blur(24px) saturate(170%); -webkit-backdrop-filter: blur(24px) saturate(170%);
}
.hero .label, .hero .k, .hero .n, .hero .note { color: var(--orange-text); }
.hero .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.hero .k { font-size: 13px; }
.hero .v { margin-top: 2px; font-size: 36px; font-weight: 700; line-height: 1.1; }
.hero .n { margin-top: 2px; font-size: 13px; }
.hero .about { display: none; }
.hero .head .note { margin-top: 8px; }
.hero > .note.phone { margin-top: 16px; }
.stack { gap: 16px; }
.axis.all { display: none; }

/* столбики */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; margin-top: 16px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; min-width: 0; }
.nowrap { white-space: nowrap; }
.bar .val { display: none; font-size: 11px; text-align: center; color: var(--muted); margin-bottom: 4px; white-space: nowrap; }
.bar .fill { border-radius: 8px; background: rgba(255, 255, 255, .34); border: 1px solid rgba(255, 255, 255, .35); min-height: 2px; }
.bar .fill.last { background: var(--day); border-color: rgba(255, 210, 170, .6); }
.bar .night { border-radius: 8px 8px 0 0; background: var(--night); border: 1px solid rgba(180, 215, 255, .5); }
.bar .day { border-radius: 0 0 8px 8px; background: var(--day); border: 1px solid rgba(255, 210, 170, .6); }
.bar .night:last-child { border-radius: 8px; }
.bar .day:first-of-type:last-child { border-radius: 8px; }
.cash .val { display: block; font-size: 12px; }
.axis { display: flex; gap: 6px; margin-top: 8px; font-size: 11px; color: rgba(244, 246, 251, .78); }
.axis span { flex: 1; text-align: center; min-width: 0; white-space: nowrap; }
.axis.ends { justify-content: space-between; }
.axis.ends span { flex: none; }
.legend { margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend i { font-style: normal; }
.legend .d { color: #FFC796; }
.legend .nt { color: #9CC8FF; margin-left: 12px; }

/* тепловая карта: дни × часы (ночь 00–06 — одной колонкой) */
.heat { display: grid; gap: 3px; margin-top: 16px; grid-template-columns: 24px repeat(18, minmax(0, 1fr)); font-size: 11px; }
.heat .h, .heat .dn { color: var(--faint); text-align: center; align-self: end; }
.heat .dn { text-align: left; align-self: center; }
.heat .h { white-space: nowrap; }
.heat .h.off { visibility: hidden; }
.heat .c { aspect-ratio: 1 / 1.15; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: transparent; border: 1px solid rgba(255, 255, 255, .10); }
.heat-scale { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--faint); }
.heat-scale .ramp { flex: 0 0 90px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(232, 131, 58, .08), rgba(232, 131, 58, .93)); }

/* строки «показатель — значение» */
.rows { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.row b { font-size: 17px; white-space: nowrap; }
.row .muted { color: var(--muted); }

.sys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.sys .v { font-size: 28px; font-weight: 700; white-space: nowrap; }
.sys .k { margin-top: 2px; font-size: 13px; color: var(--muted); }

footer { margin: 8px 4px 0; font-size: 12px; line-height: 1.5; color: var(--faint); }
.err { text-align: center; padding: 32px 22px; }
.err button { margin-top: 16px; font: inherit; font-weight: 600; color: var(--text); padding: 10px 20px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .4); cursor: pointer; }
.loading { color: var(--muted); padding: 40px 4px; }

/* планшет и монитор — как макет «компьютер» */
@media (min-width: 760px) {
  .page { padding: 48px 32px 56px; gap: 20px; }
  .b1 { width: 640px; height: 640px; left: -160px; top: -160px; opacity: .5; filter: blur(110px); }
  .b2 { width: 620px; height: 620px; right: -200px; top: 120px; opacity: .5; filter: blur(120px); }
  .b3 { width: 600px; height: 600px; left: 35%; bottom: -260px; opacity: .4; filter: blur(120px); }
  header { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
  h1 { font-size: 44px; letter-spacing: -1px; }
  .when { font-size: 16px; }
  .pill { align-self: flex-end; font-size: 14px; padding: 8px 16px; margin: 0; }
  .card { padding: 26px; backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%); }
  .wide-only { display: block; }
  .stack { gap: 20px; }
  .top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .top > .g2 { display: contents; }
  .axis.all { display: flex; }
  .axis.ends { display: none; }
  .top .label, .top .g2 .label { font-size: 15px; }
  .top .big, .top .mid { margin-top: 8px; font-size: 52px; font-weight: 700; letter-spacing: -2px; line-height: 1; }
  .top .sub { font-size: 15px; margin-top: 12px; }
  .hero { padding: 30px 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 32px; }
  .hero .head { flex: 1 1 300px; }
  .hero .about { display: block; font-size: 15px; line-height: 1.5; }
  .hero .head .label { font-size: 17px; }
  .hero .pair { flex: 2 1 440px; margin: 0; gap: 32px; }
  .hero .v { font-size: 48px; }
  .hero .k, .hero .n { font-size: 14px; }
  .hero .week { flex: 1 1 200px; }
  .hero .week .v { font-size: 22px; line-height: 1.35; }
  .hero > .note.phone { display: none; }
  .two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .bars { height: 220px; gap: 10px; margin-top: 20px; }
  .axis { gap: 10px; }
  .heat { grid-template-columns: 32px repeat(18, minmax(0, 1fr)); gap: 4px; font-size: 12px; }
  .heat .h.off { visibility: visible; }
}
@media (min-width: 1100px) {
  .top { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bar .val { display: block; }
  .heat .c { color: rgba(255, 255, 255, .9); aspect-ratio: auto; height: 30px; }
  .page { padding: 48px 40px 56px; }
  .top .big, .top .mid { font-size: 60px; }
}
/* меньше прозрачности, если так настроено в системе */
@media (prefers-reduced-transparency: reduce) {
  .card, .hero { background: rgba(20, 32, 64, .92); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
