/* ============ DASHBOARD — Apple Product Cards (compact) ============ */

/* === NAV === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(251, 251, 253, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}
.nav-left { display: flex; align-items: center; gap: 12px; }
.nav-logo {
  width: 28px; height: 28px;
  background: linear-gradient(180deg, #0071e3 0%, #0056b3 100%);
  color: #ffffff;
  display: grid; place-items: center;
  font-weight: 600; font-size: 14px;
  border-radius: 8px;
  box-shadow: 0 4px 10px -4px rgba(0, 113, 227, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.nav-title { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.nav-sub {
  font-size: 13px; color: var(--ink-3); font-weight: 500;
  padding-left: 12px; margin-left: 4px;
  border-left: 1px solid var(--line);
}
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-meta {
  font-size: 13px; color: var(--ink-3); font-weight: 500;
  font-variant-numeric: tabular-nums; letter-spacing: -0.005em;
}

/* === STAGE (на весь экран, без скролла) === */
.stage {
  position: relative;
  display: grid;
  place-items: center;
  height: 100vh;
  padding: 68px 28px 28px;
  overflow: hidden;
}
.scene-empty { font-size: 18px; color: var(--ink-3); }

/* === CARD wrapper === */
.card {
  width: 100%;
  max-width: 1060px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  text-align: center;
  animation: card-in 0.5s var(--ease) both;
}
.card > .eyebrow,
.card > .title {
  align-self: center;
}
.card.exiting { animation: card-out 0.25s var(--ease) forwards; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes card-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-10px) scale(0.99); }
}

/* --- Eyebrow --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 980px;
  background: var(--bg-card);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}
.eyebrow .stage-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue);
}
.card.level-high .eyebrow .stage-dot { background: var(--green-deep); }
.card.level-mid  .eyebrow .stage-dot { background: var(--orange); }
.card.level-low  .eyebrow .stage-dot { background: var(--red-deep); }
.eyebrow .code { color: var(--ink-3); font-weight: 500; }
.eyebrow .sep  { color: var(--ink-4); }

/* --- Title — компактный, до двух строк --- */
.title {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.028em;
  color: var(--ink);
  max-width: 820px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========= HERO CARD — всё внутри одной плитки ========= */
.hero-card {
  margin-top: 4px;
  width: 100%;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 22px 28px 20px;
  position: relative;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06),
              0 16px 48px -16px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hero-badge {
  width: 42px;
  height: 42px;
  background: linear-gradient(180deg, #0071e3 0%, #0056b3 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 600;
  border-radius: 13px;
  box-shadow: 0 8px 20px -6px rgba(0, 113, 227, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
  letter-spacing: -0.02em;
}
.card.level-high .hero-badge {
  background: linear-gradient(180deg, #34c759 0%, #28a745 100%);
  box-shadow: 0 8px 20px -6px rgba(52, 199, 89, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.card.level-mid .hero-badge {
  background: linear-gradient(180deg, #ffb340 0%, #ff9f0a 100%);
  box-shadow: 0 8px 20px -6px rgba(255, 159, 10, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.card.level-low .hero-badge {
  background: linear-gradient(180deg, #ff6b6b 0%, #d70015 100%);
  box-shadow: 0 8px 20px -6px rgba(255, 59, 48, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.hero-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-date {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* Бейдж срока сдачи (Apple pill) */
.deadline-badge {
  padding: 6px 14px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.deadline-badge.calm {
  background: var(--bg-muted);
  color: var(--ink-2);
}
.deadline-badge.soon {
  background: rgba(0, 113, 227, 0.12);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.2);
}
.deadline-badge.urgent {
  background: rgba(255, 159, 10, 0.15);
  color: var(--orange);
  box-shadow: inset 0 0 0 1px rgba(255, 159, 10, 0.28);
}
.deadline-badge.overdue {
  background: rgba(255, 59, 48, 0.12);
  color: var(--red-deep);
  box-shadow: inset 0 0 0 1px rgba(255, 59, 48, 0.3);
}

/* --- Центральный блок цифры маржи --- */
.hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hero-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-figure {
  font-size: 76px;
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.045em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hero-figure .currency {
  font-weight: 200;
  font-size: 40px;
  color: var(--ink-3);
  margin-left: 8px;
  letter-spacing: -0.02em;
}
.card.level-high .hero-figure,
.card.level-high .hero-figure .currency { color: var(--green-deep); }
.card.level-mid .hero-figure,
.card.level-mid .hero-figure .currency  { color: var(--orange); }
.card.level-low .hero-figure,
.card.level-low .hero-figure .currency  { color: var(--red-deep); }
.card.level-high .hero-figure .currency,
.card.level-mid  .hero-figure .currency,
.card.level-low  .hero-figure .currency { opacity: 0.55; }

.hero-pct {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 980px;
  background: var(--bg-muted);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}
.hero-pct .arrow { font-weight: 600; }
.hero-pct .pct-num { font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-pct .pct-dim { color: currentColor; opacity: 0.55; margin-left: 4px; font-weight: 500; }
.card.level-high .hero-pct { background: rgba(52, 199, 89, 0.12); color: var(--green-deep); }
.card.level-mid  .hero-pct { background: rgba(255, 159, 10, 0.14); color: var(--orange); }
.card.level-low  .hero-pct { background: rgba(255, 59, 48, 0.1);  color: var(--red-deep); }

/* --- Сумма и расходы (inline в hero-card) --- */
.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.hs-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}
.hs-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hs-value {
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.hs-value .currency {
  color: var(--ink-3);
  font-weight: 400;
  margin-left: 4px;
  font-size: 14px;
}
.hs-value.down { color: var(--red-deep); }
.hs-divider {
  background: var(--line);
  width: 1px;
  justify-self: center;
  height: 70%;
  align-self: center;
}

/* --- Менеджеры: отдельный крупный ряд под hero-card --- */
.managers-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 2px;
}
.mgr-tile {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: var(--bg-card);
  border-radius: 20px;
  text-align: left;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06),
              0 8px 24px -8px rgba(0, 0, 0, 0.06),
              inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.mgr-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08),
              0 14px 30px -10px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.mgr-tile.empty { opacity: 0.55; }

.mgr-tile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #ebebf0 0%, #d6d6dc 100%);
  display: grid; place-items: center;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.mgr-tile-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.mgr-tile-avatar.empty {
  background: var(--bg-muted);
  color: var(--ink-4);
  font-size: 28px; font-weight: 300;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.mgr-tile-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mgr-tile-role {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mgr-tile-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === PROGRESS === */
.progress {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  z-index: 40;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--blue);
  transition: width linear;
  box-shadow: 0 0 8px rgba(0, 113, 227, 0.5);
}

/* === Error === */
.error-banner {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.2);
  color: var(--red-deep);
  padding: 9px 16px;
  border-radius: 980px;
  font-size: 12px;
  z-index: 60;
  font-weight: 500;
  backdrop-filter: blur(10px);
}
