/* Профиль: самостоятельная визуальная система поверх существующей панели. */
.profile-dashboard {
  --profile-violet: #ad7cff;
  --profile-pink: #ee6fc8;
  --profile-ink: #0c0816;
  gap: 22px !important;
  max-width: 1440px;
  margin: 0 auto;
}

.profile-dashboard > .page-header {
  position: relative;
  padding: 8px 4px 16px;
  margin: 0 !important;
  border-bottom: 1px solid rgba(190, 145, 255, 0.16);
}

.profile-dashboard > .page-header h2 {
  font-size: clamp(30px, 3.2vw, 42px) !important;
  line-height: 1;
  letter-spacing: -0.055em !important;
  background: linear-gradient(105deg, #fff 25%, #d8c4ff 65%, #f1a7d9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

.profile-dashboard > .page-header .page-subtitle {
  margin-top: 9px;
  color: #9f91b5 !important;
  font-size: 12px !important;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.profile-summary-hero {
  position: relative;
  isolation: isolate;
  padding: 24px 28px !important;
  overflow: hidden;
  border: 1px solid rgba(174, 124, 255, .32) !important;
  background:
    radial-gradient(circle at 80% -30%, rgba(204, 117, 255, .32), transparent 38%),
    radial-gradient(circle at 4% 140%, rgba(92, 65, 201, .24), transparent 40%),
    linear-gradient(130deg, rgba(30, 18, 54, .96), rgba(13, 8, 27, .94)) !important;
  box-shadow: 0 22px 55px rgba(3, 1, 9, .35), inset 0 1px 0 rgba(255, 255, 255, .08) !important;
}

.profile-summary-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -60px;
  bottom: -115px;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(205, 164, 255, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(205, 164, 255, .025), 0 0 0 85px rgba(205, 164, 255, .018);
}

.profile-summary-hero img {
  width: 72px !important;
  height: 72px !important;
  border-radius: 22px !important;
  border-color: rgba(230, 210, 255, .7) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .36), 0 0 0 5px rgba(176, 124, 255, .11) !important;
}

.profile-summary-hero .stat-card {
  min-height: 68px;
  border-color: rgba(228, 208, 255, .12) !important;
  background: linear-gradient(145deg, rgba(255,255,255,.09), rgba(255,255,255,.025)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}

.profile-middle-grid {
  grid-template-columns: minmax(260px, 310px) minmax(0, 1fr) !important;
  gap: 20px !important;
}

.profile-period-card,
.profile-activity-card,
.profile-notes-card,
.profile-kpi-card,
.profile-history-card {
  border: 1px solid rgba(181, 137, 255, .17) !important;
  background: linear-gradient(145deg, rgba(31, 20, 52, .76), rgba(15, 10, 29, .93)) !important;
  box-shadow: 0 14px 35px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.035) !important;
}

.profile-period-card {
  position: sticky;
  top: 18px;
  padding: 18px !important;
}

.profile-period-card .stats-period-header > div:first-child {
  width: 100%;
  justify-content: space-between;
  padding: 8px 10px !important;
  border: 1px solid rgba(190, 150, 255, .18);
  background: rgba(8, 5, 18, .36) !important;
  border-radius: 12px !important;
}

.profile-period-card .stats-period-menu {
  right: 0;
  min-width: unset !important;
  background: #1c122e !important;
  border-color: rgba(196, 158, 255, .3) !important;
}

.profile-period-card .daily-stat-item {
  padding: 11px 12px !important;
  border-color: rgba(255,255,255,.06) !important;
  background: rgba(255,255,255,.025) !important;
}

.profile-period-card .daily-stat-item:hover {
  border-color: rgba(190, 145, 255, .32) !important;
  box-shadow: 0 8px 16px rgba(0,0,0,.18);
}

.weekly-notes-grid {
  gap: 20px !important;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .9fr) !important;
}

.profile-activity-card {
  min-height: 225px;
  padding: 20px 22px !important;
}

.profile-activity-card > div:last-child > div {
  min-width: 40px;
}

.profile-activity-card > div:last-child > div:hover > div {
  filter: brightness(1.35);
  transform: translateY(-3px);
}

.profile-notes-card {
  min-height: 225px;
  padding: 20px 22px !important;
}

.profile-notes-card textarea {
  border-color: rgba(189, 151, 255, .16) !important;
  background: rgba(8, 5, 18, .48) !important;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.profile-notes-card textarea:focus {
  border-color: rgba(184, 129, 255, .75) !important;
  background: rgba(8, 5, 18, .72) !important;
  box-shadow: 0 0 0 3px rgba(159, 104, 249, .14);
}

.profile-note-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(91, 230, 176, .22);
  border-radius: 999px;
  background: rgba(44, 185, 124, .08);
  color: #8be6bb;
  font-size: 10px;
  font-weight: 800;
}

.profile-note-private {
  display: flex;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border: 1px dashed rgba(194, 160, 255, .22);
  border-radius: 12px;
  color: var(--text3);
  font-size: 12px;
  line-height: 1.55;
}

.profile-kpi-card {
  position: relative;
  overflow: hidden;
  margin-top: 2px;
  padding: 20px !important;
}

.profile-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(#ba82ff, #ed75c9);
}

.profile-kpi-card > div:last-child {
  margin-top: 4px !important;
}

.profile-history-card {
  padding: 20px 22px !important;
}

@media (max-width: 1120px) {
  .profile-middle-grid { grid-template-columns: 1fr !important; }
  .profile-period-card { position: static; }
  .profile-period-card .stats-period-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .profile-dashboard { gap: 14px !important; }
  .profile-summary-hero { padding: 18px !important; }
  .profile-summary-hero > div { align-items: flex-start !important; }
  .profile-summary-hero .stat-card { flex: 1 1 118px; }
  .weekly-notes-grid { grid-template-columns: 1fr !important; }
  .profile-period-card .stats-period-list { grid-template-columns: 1fr !important; }
  .profile-activity-card, .profile-notes-card { min-height: 0; }
}
