/* =========================================
   Atlas — Apple Activity / Fitness inspired
   ========================================= */
:root {
  /* база */
  --bg: #07070b;
  --bg-tint: #0d0d14;
  --surface: rgba(255,255,255,0.04);
  --surface-2: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --text: #f5f5f7;
  --muted: #98989d;
  --muted-2: #6e6e73;

  /* акцентная палитра (Apple Activity) */
  --move-1: #ff375f;     /* красный — Move */
  --move-2: #ff9f0a;     /* оранжевый */
  --exercise-1: #b6ff45; /* зелёный — Exercise */
  --exercise-2: #00ffa3; /* бирюзовый */
  --stand-1: #5ac8fa;    /* голубой — Stand */
  --stand-2: #af52de;    /* фиолетовый */

  --energy-1: #b6ff45;
  --energy-2: #00ffa3;
  --sleep-1: #5a9fff;
  --sleep-2: #af52de;
  --hr-1: #ff375f;
  --hr-2: #ff6482;
  --pawn-1: #5ac8fa;
  --pawn-2: #007aff;

  --radius: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  /* «обои» — мягкие пятна цвета на фоне */
  background-image:
    radial-gradient(800px 600px at 0% 0%, rgba(255,55,95,0.10), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(0,255,163,0.06), transparent 60%),
    radial-gradient(800px 600px at 50% 100%, rgba(90,159,255,0.08), transparent 60%);
  background-attachment: fixed;
}

button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
.hidden { display: none !important; }

/* =================== SIDEBAR =================== */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky; top: 0;
  height: 100vh;
  padding: 24px 14px 18px;
  background: rgba(13,13,20,0.55);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 24px; }
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 9px;
  background:
    conic-gradient(from 180deg at 50% 50%,
      var(--move-1) 0deg, var(--move-2) 90deg,
      var(--exercise-1) 180deg, var(--stand-1) 270deg, var(--move-1) 360deg);
  box-shadow: 0 4px 18px rgba(255,55,95,0.4);
}
.brand-name {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  display: flex; align-items: center; gap: 12px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: background 0.15s, color 0.15s, transform 0.05s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item:active { transform: scale(0.98); }
.nav-item.active {
  background: var(--surface-2);
  color: var(--text);
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.ws-row { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.ws-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
}
.ws-dot.live {
  background: var(--exercise-1);
  box-shadow: 0 0 10px var(--exercise-1);
  animation: ws-pulse 1.8s infinite;
}
@keyframes ws-pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.7); opacity: 0.6; }
}

/* =================== MAIN =================== */
.main { flex: 1; padding: 32px 40px 80px; min-width: 0; }

.topbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px;
}
.hello {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, #cccccf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.clock {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.topbar-right { display: flex; align-items: center; gap: 18px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--surface);
  border-radius: 100px;
  border: 1px solid var(--border);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--move-2), var(--move-1));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}
.user-name { font-size: 13.5px; font-weight: 600; }
.user-role { font-size: 11.5px; color: var(--muted); }

/* =================== GRID =================== */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

@media (max-width: 1200px) {
  .col-3 { grid-column: span 6; }
  .col-4, .col-5 { grid-column: span 6; }
  .col-7, .col-8 { grid-column: span 12; }
}
@media (max-width: 720px) {
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 12; }
  .main { padding: 22px 18px 60px; }
  .hello { font-size: 26px; }
  .sidebar {
    width: 62px;
    padding: 18px 8px;
  }
  .brand-name, .nav-item span, .sidebar-footer { display: none; }
  .nav-item { justify-content: center; padding: 11px; }
}

/* =================== CARDS =================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}
.card.tinted {
  background:
    radial-gradient(800px 400px at 0% 0%, var(--tint, transparent), transparent 70%),
    var(--surface);
}

/* большие героические карточки с градиентом */
.bigcard {
  border-radius: var(--radius);
  padding: 26px 28px;
  position: relative;
  overflow: hidden;
  color: white;
  min-height: 180px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.bigcard::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bigbg);
  z-index: -1;
}
.bigcard.energy { --bigbg: linear-gradient(135deg, var(--energy-1) 0%, var(--energy-2) 100%); color: #0a2e0a; }
.bigcard.sleep { --bigbg: linear-gradient(135deg, var(--sleep-2) 0%, var(--sleep-1) 100%); }
.bigcard.move { --bigbg: linear-gradient(135deg, var(--move-1) 0%, var(--move-2) 100%); }
.bigcard.pawn { --bigbg: linear-gradient(135deg, var(--pawn-2) 0%, var(--pawn-1) 100%); }

.bigcard-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}
.bigcard-value {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}
.bigcard-value .unit {
  font-size: 22px;
  font-weight: 600;
  opacity: 0.8;
  margin-left: 6px;
}
.bigcard-foot {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.75;
}
.bigcard-icon {
  position: absolute;
  top: 22px; right: 22px;
  width: 32px; height: 32px;
  opacity: 0.6;
}

/* мелкие KPI */
.kpi-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.kpi-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.kpi-unit { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi-foot {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.spark {
  margin-top: 12px;
  width: 100%;
  height: 38px;
  display: block;
}

/* card heading */
.card h3 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* =================== ACTIVITY RINGS (Apple) =================== */
.rings-stage {
  position: relative;
  width: 260px; height: 260px;
  margin: 8px auto 0;
}
.rings-stage svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; opacity: 0.18; }
.ring-fg {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.25,1,0.3,1);
  filter: drop-shadow(0 0 10px currentColor);
}
.rings-legend {
  display: flex;
  justify-content: space-around;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.legend-item {
  display: flex; flex-direction: column;
  align-items: center;
  gap: 4px;
}
.legend-swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
}
.legend-swatch.move { background: linear-gradient(135deg, var(--move-1), var(--move-2)); }
.legend-swatch.exercise { background: linear-gradient(135deg, var(--exercise-1), var(--exercise-2)); }
.legend-swatch.stand { background: linear-gradient(135deg, var(--stand-1), var(--stand-2)); }
.legend-title {
  font-size: 10.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.legend-value {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* =================== HERO (Today) =================== */
.hero-today {
  grid-column: span 12;
  background:
    radial-gradient(900px 400px at 15% 0%, rgba(255,55,95,0.18), transparent 60%),
    radial-gradient(900px 400px at 85% 100%, rgba(0,255,163,0.10), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 36px;
  align-items: center;
}
@media (max-width: 1100px) { .hero-today { grid-template-columns: 1fr; } }

.hero-left .greeting {
  font-size: 14px;
  font-weight: 600;
  color: var(--move-1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hero-left .headline {
  margin: 10px 0 14px;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, #fff 0%, #d8d8db 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-left .sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 540px;
}

/* =================== Mood/Energy chips =================== */
.mood-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.mood-card {
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  min-height: 150px;
  border: 1px solid var(--border);
}
.mood-card .gradient-bg {
  position: absolute; inset: 0;
  opacity: 0.85;
  z-index: -1;
}
.mood-energy .gradient-bg {
  background: linear-gradient(135deg, #b6ff45 0%, #00ffa3 100%);
}
.mood-mood .gradient-bg {
  background: linear-gradient(135deg, #af52de 0%, #ff6482 100%);
}
.mood-card .mood-label {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(0,0,0,0.65);
}
.mood-card .mood-value {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0a0a0f;
  margin-top: 6px;
  line-height: 1;
}
.mood-card .mood-foot {
  font-size: 13px;
  color: rgba(0,0,0,0.55);
  margin-top: 8px;
  font-weight: 500;
}

/* =================== row-list/ticket =================== */
.row-list {
  display: flex; flex-direction: column;
  gap: 8px;
}
.row {
  display: flex; align-items: center;
  padding: 13px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  gap: 12px;
}
.row-main { flex: 1; min-width: 0; }
.row-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.row-right {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--muted);
}

/* pills */
.pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 100px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-transform: uppercase;
}
.pill.blue { background: rgba(90,200,250,0.18); color: var(--stand-1); }
.pill.green { background: rgba(182,255,69,0.18); color: var(--exercise-1); }
.pill.orange { background: rgba(255,159,10,0.18); color: var(--move-2); }
.pill.red { background: rgba(255,55,95,0.18); color: var(--move-1); }
.pill.purple { background: rgba(175,82,222,0.18); color: var(--stand-2); }
.pill.muted { background: var(--surface-2); color: var(--muted); }

/* buttons */
.btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--surface); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--move-1) 0%, var(--move-2) 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 22px rgba(255,55,95,0.3);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.small { padding: 5px 12px; font-size: 12px; }

.input {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--move-1); }

/* slider */
.slider-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0;
}
.slider-label {
  width: 110px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.slider-row input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: linear-gradient(90deg, var(--move-1) 0%, var(--move-2) 100%);
  border-radius: 100px;
  outline: none;
}
.slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.slider-value {
  width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 700;
}

/* hint / setup */
.hint-card {
  background:
    linear-gradient(135deg, rgba(90,200,250,0.10) 0%, rgba(175,82,222,0.06) 100%),
    var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.hint-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}
.setup-list {
  margin: 0;
  padding-left: 22px;
  display: flex; flex-direction: column;
  gap: 14px;
}
.setup-list li {
  font-size: 13.5px;
  line-height: 1.55;
}
.setup-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
.code-row {
  margin-top: 8px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  flex-wrap: wrap;
}
.code-row code {
  flex: 1;
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 12.5px;
  color: var(--stand-1);
  word-break: break-all;
}

/* workouts */
.workout-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.workout-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--move-1), var(--move-2));
  flex-shrink: 0;
}

/* live event flash */
.live-flash {
  position: fixed;
  top: 24px; right: 24px;
  padding: 12px 18px 12px 16px;
  background: rgba(15,15,20,0.95);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(20px);
  border-radius: 14px;
  font-size: 13px;
  color: var(--text);
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 1500;
  display: flex; align-items: center; gap: 10px;
  max-width: 340px;
}
.live-flash::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--exercise-1);
  box-shadow: 0 0 8px var(--exercise-1);
}
.live-flash.show {
  opacity: 1;
  transform: translateX(0);
}

/* toast */
.toast {
  position: fixed;
  bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: rgba(20,20,26,0.95);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(20px);
  padding: 12px 22px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* simple ring (small) */
.mini-ring {
  position: relative;
  display: inline-flex;
}
.mini-ring svg { transform: rotate(-90deg); }
.mini-ring-num {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* worker cards */
.job-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.job-head { display: flex; justify-content: space-between; align-items: center; }
.job-name { font-weight: 600; font-size: 14px; }
.job-next { font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.job-trigger { font-size: 11px; color: var(--muted-2); margin-top: 4px; font-family: "SF Mono", monospace; }

.run-item {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: center;
  transition: background 0.2s;
}
.run-item:last-child { border-bottom: 0; }
.run-item.fresh {
  background: rgba(182,255,69,0.05);
  animation: fresh 1.6s ease-out;
}
@keyframes fresh {
  0% { background: rgba(182,255,69,0.20); }
  100% { background: rgba(182,255,69,0.0); }
}
.run-worker { font-weight: 600; }
.run-action { color: var(--muted); }
.run-time { color: var(--muted-2); font-size: 12px; font-variant-numeric: tabular-nums; }

/* dots in lists */
.dot-list {
  display: flex; flex-direction: column; gap: 10px;
}
.dot-row {
  display: flex; align-items: center; gap: 12px;
  font-size: 13.5px;
}
.dot-row .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-row .label { color: var(--muted); flex: 1; }
.dot-row .v { font-variant-numeric: tabular-nums; font-weight: 600; }

textarea.input {
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
  font-size: 14px;
}
