/* Avahouse Clay Dashboard — soft 3D claymorphism */

:root {
  --bg: #F0EBE3;
  --bg-warm: #E8E0D4;
  --cream: #FAF7F2;
  --text: #3D3548;
  --text-soft: #7A7088;
  --lavender: #C4B5E8;
  --lavender-deep: #A898D8;
  --lavender-dark: #8B7BC4;
  --pink: #F4B4D4;
  --pink-deep: #E898C0;
  --mint: #A8E6CF;
  --mint-deep: #7DD4A8;
  --yellow: #FFE4A0;
  --yellow-deep: #FFD166;
  --blue: #A8D4F0;
  --blue-deep: #7BBFE8;
  --white: #FFFFFF;
  --shadow-clay: 8px 8px 20px rgba(160, 140, 120, 0.25), -6px -6px 16px rgba(255, 255, 255, 0.85);
  --shadow-clay-hover: 12px 14px 28px rgba(160, 140, 120, 0.32), -8px -8px 20px rgba(255, 255, 255, 0.9);
  --shadow-inset: inset 4px 4px 10px rgba(160, 140, 120, 0.15), inset -3px -3px 8px rgba(255, 255, 255, 0.7);
  --shadow-pressed: inset 5px 5px 12px rgba(160, 140, 120, 0.22), inset -2px -2px 6px rgba(255, 255, 255, 0.5);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --sidebar-w: 240px;
  --transition: 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(196, 181, 232, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 95% 100%, rgba(168, 230, 207, 0.15), transparent 50%);
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

button { font: inherit; cursor: pointer; border: none; background: none; }

/* Layout */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.mobile-bar {
  display: none;
}

.main {
  padding: 28px 32px 40px;
  overflow-x: hidden;
}

/* Clay primitives */
.clay-card {
  border-radius: var(--radius-xl);
  background: var(--cream);
  box-shadow: var(--shadow-clay);
  transition: transform var(--transition), box-shadow var(--transition);
}

.clay-card[data-lift]:hover,
.clay-card[data-tilt]:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-clay-hover);
}

.clay-card--lavender {
  background: linear-gradient(145deg, var(--lavender) 0%, var(--lavender-deep) 100%);
  color: var(--white);
}

.clay-card--purple {
  background: linear-gradient(145deg, #D4C8F0 0%, var(--lavender) 100%);
}

.clay-card--pink {
  background: linear-gradient(145deg, var(--pink) 0%, var(--pink-deep) 100%);
}

.clay-card--yellow {
  background: linear-gradient(145deg, var(--yellow) 0%, var(--yellow-deep) 100%);
}

.clay-card--mint {
  background: linear-gradient(145deg, var(--mint) 0%, var(--mint-deep) 100%);
}

.clay-card--gradient {
  background: linear-gradient(160deg, var(--lavender) 0%, var(--pink) 50%, var(--mint) 100%);
  color: var(--white);
}

.clay-inset {
  border-radius: 999px;
  background: var(--cream);
  box-shadow: var(--shadow-inset);
}

/* Buttons */
.clay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--cream);
  box-shadow: var(--shadow-clay);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.clay-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-clay-hover);
}

.clay-btn:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-pressed);
}

.clay-btn--white {
  background: var(--white);
  color: var(--lavender-dark);
}

.clay-btn--icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.clay-btn--sm {
  padding: 9px 16px;
  font-size: 0.8rem;
}

.clay-btn--lg {
  padding: 14px 28px;
  font-size: 0.95rem;
}

.clay-btn--notify {
  position: relative;
}

.clay-btn--play {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--white);
  flex-shrink: 0;
}

.notify-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #FF6B8A;
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(255, 107, 138, 0.4);
}

/* Sidebar */
.clay-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  background: linear-gradient(180deg, var(--lavender-deep) 0%, var(--lavender-dark) 100%);
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  box-shadow: 8px 0 32px rgba(139, 123, 196, 0.25);
  z-index: 100;
}

.sidebar__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 24px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-logo {
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(180, 60, 140, 0.45));
  transition: transform var(--transition), filter var(--transition);
}

.brand-logo--sm { width: 32px; height: 32px; }

.brand-logo--hero {
  width: 120px;
  height: 120px;
  animation: logo-float 4s ease-in-out infinite;
}

.sidebar__brand:hover .brand-logo,
.mobile-bar__brand:hover .brand-logo {
  transform: scale(1.06) rotate(-2deg);
  filter: drop-shadow(0 6px 18px rgba(220, 80, 180, 0.55));
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

.hero__logo-float {
  position: absolute;
  top: -12px;
  right: -8px;
  z-index: 4;
  pointer-events: none;
}

.sidebar__profile {
  text-align: center;
  padding: 16px 8px;
}

.sidebar__avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.sidebar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar__greeting {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
}

.sidebar__name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.02em;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.sidebar__link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.sidebar__link.is-active {
  color: var(--lavender-dark);
  background: var(--white);
  box-shadow: var(--shadow-clay);
}

.sidebar__link-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar__link.is-active .sidebar__link-icon {
  background: var(--lavender);
  color: var(--white);
}

.sidebar__promo {
  padding: 18px;
  margin-top: auto;
  text-align: center;
}

.sidebar__promo p {
  margin: 0 0 12px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text);
}

.sidebar__promo-icon {
  margin-bottom: 10px;
}

.sidebar-backdrop {
  display: none;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 18px;
}

.search__icon {
  flex-shrink: 0;
  color: var(--text-soft);
}

.search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 0;
  font: inherit;
  color: var(--text);
  outline: none;
}

.search input::placeholder { color: var(--text-soft); }

.topbar__actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 32px 36px;
  margin-bottom: 24px;
  overflow: hidden;
  position: relative;
}

.hero__eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.hero__title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.hero__title span {
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 10px;
  border-radius: 12px;
}

.hero__lead {
  margin: 0 0 20px;
  max-width: 420px;
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0.92;
}

.hero__visual {
  position: relative;
  width: 280px;
  height: 180px;
}

.hero__avatar-stack {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero__avatar {
  position: absolute;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.hero__avatar--1 {
  width: 90px;
  height: 90px;
  left: 0;
  bottom: 20px;
  z-index: 1;
}

.hero__avatar--2 {
  width: 110px;
  height: 110px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.hero__avatar--3 {
  width: 80px;
  height: 80px;
  right: 0;
  bottom: 30px;
  z-index: 2;
}

.hero__deco--plant {
  position: absolute;
  right: -10px;
  bottom: -10px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  min-height: 130px;
}

.stat__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  display: grid;
  place-items: center;
  color: var(--text);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5);
}

.stat__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-soft);
}

.stat__value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.stat__trend {
  margin-top: auto;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  align-self: flex-start;
}

.stat__trend--up { color: #2D8A5E; }
.stat__trend--neutral { color: var(--text-soft); }

/* Panels */
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.panel-head__meta {
  font-size: 0.75rem;
  color: var(--text-soft);
}

.panel-head__link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--lavender-dark);
}

.panel-head--light h2,
.panel-head--light .panel-head__meta {
  color: var(--white);
}

.panel-head--light .panel-head__meta {
  opacity: 0.85;
}

/* Charts row */
.charts-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-panel,
.donut-panel {
  padding: 24px;
}

.bar-chart__bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 180px;
  padding-top: 10px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  height: 100%;
  justify-content: flex-end;
}

.bar-col span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-soft);
}

.bar-cylinder {
  width: 100%;
  max-width: 36px;
  height: 0;
  border-radius: 18px 18px 8px 8px;
  position: relative;
  transition: height 1s cubic-bezier(0.34, 1.2, 0.64, 1);
  box-shadow:
    inset 0 -4px 8px rgba(0, 0, 0, 0.08),
    inset 0 4px 8px rgba(255, 255, 255, 0.4),
    4px 4px 12px rgba(160, 140, 120, 0.2);
}

.bar-chart.is-animated .bar-cylinder {
  height: var(--bar-h, 50%);
}

.bar-cylinder--lavender { background: linear-gradient(180deg, var(--lavender) 0%, var(--lavender-deep) 100%); }
.bar-cylinder--pink { background: linear-gradient(180deg, var(--pink) 0%, var(--pink-deep) 100%); }
.bar-cylinder--mint { background: linear-gradient(180deg, var(--mint) 0%, var(--mint-deep) 100%); }
.bar-cylinder--yellow { background: linear-gradient(180deg, var(--yellow) 0%, var(--yellow-deep) 100%); }
.bar-cylinder--blue { background: linear-gradient(180deg, var(--blue) 0%, var(--blue-deep) 100%); }

/* Donut */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}

.donut-chart {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.donut-seg {
  transition: stroke-dasharray 1.2s ease;
}

.donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.donut-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.donut-legend strong {
  margin-left: auto;
  color: var(--text);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot--lavender { background: var(--lavender); }
.dot--pink { background: var(--pink); }
.dot--mint { background: var(--mint); }
.dot--yellow { background: var(--yellow); }

/* Lists row */
.lists-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.recent,
.featured {
  padding: 24px;
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: var(--shadow-inset);
  transition: transform 0.2s, box-shadow 0.2s;
}

.recent-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-clay);
}

.recent-item__thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.recent-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-item__info {
  flex: 1;
  min-width: 0;
}

.recent-item__info strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

.recent-item__info span {
  font-size: 0.75rem;
  color: var(--text-soft);
}

/* Featured */
.featured__scene {
  text-align: center;
}

.featured__avatars {
  position: relative;
  height: 120px;
  margin-bottom: 16px;
}

.featured__avatar {
  position: absolute;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.featured__avatar--center {
  width: 80px;
  height: 80px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.featured__avatar--left {
  width: 56px;
  height: 56px;
  left: 20%;
  top: 60%;
  transform: translateY(-50%);
  z-index: 1;
}

.featured__avatar--right {
  width: 56px;
  height: 56px;
  right: 20%;
  top: 60%;
  transform: translateY(-50%);
  z-index: 1;
}

.featured__caption {
  margin: 0 0 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0.92;
}

/* CTA banner */
.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 36px;
}

.cta-banner__content h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cta-banner__content p {
  margin: 0 0 18px;
  max-width: 480px;
  font-size: 0.9rem;
  opacity: 0.9;
}

.cta-banner__deco {
  flex-shrink: 0;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.12));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .clay-card[data-lift]:hover,
  .clay-card[data-tilt]:hover {
    transform: none;
  }

  .bar-chart.is-animated .bar-cylinder {
    transition: none;
  }
}

/* Responsive */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .lists-row { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .mobile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--cream);
    box-shadow: var(--shadow-clay);
    position: sticky;
    top: 0;
    z-index: 200;
  }

  .mobile-bar__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--lavender-dark);
    flex: 1;
  }

  .clay-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(280px, 85vw);
    height: 100vh;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    transform: translateX(-110%);
    transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  }

  .clay-sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(61, 53, 72, 0.4);
    z-index: 90;
    backdrop-filter: blur(4px);
  }

  .sidebar-backdrop:not([hidden]) {
    display: block;
  }

  .main {
    padding: 20px 16px 32px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .hero__visual {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }

  .cta-banner {
    flex-direction: column;
    text-align: center;
    padding: 28px 24px;
  }

  .donut-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .search { max-width: 100%; order: 2; flex-basis: 100%; }
}
