:root {
  --bg: #0f1216;
  --bg-soft: #171c22;
  --card: #1f252d;
  --card-soft: #232b34;
  --accent: #ffb347;
  --accent-2: #ff6f91;
  --text: #f4f5f7;
  --muted: #9aa4b2;
  --success: #4ade80;
  --danger: #f87171;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #202734 0%, #0b0e13 45%, #0a0c10 100%);
  color: var(--text);
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: linear-gradient(120deg, rgba(255, 179, 71, 0.15), rgba(255, 111, 145, 0.2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(130deg, var(--accent), var(--accent-2));
  color: #1a1a1a;
  font-weight: 700;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

button.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #181818;
}

button.secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

button.icon {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 4px 8px;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding: 24px 32px 40px;
  flex: 1;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.user-card {
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius);
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(130deg, #2b3340, #3b4555);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.user-name {
  font-weight: 600;
}

.user-meta {
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  padding: 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.nav-item {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
  border: 1px solid transparent;
}

.nav-item.active {
  background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius);
}

.stat {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.stat strong {
  color: var(--text);
}

.content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.view {
  display: none;
  gap: 24px;
  flex-direction: column;
}

.view.active {
  display: flex;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
}

.hero h1 {
  font-size: 34px;
  margin-bottom: 12px;
}

.hero p {
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.hero-card {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-title {
  font-weight: 600;
  margin-bottom: 14px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.tile {
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-soft);
  color: var(--text);
}

.section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-weight: 600;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
  position: relative;
}

.card img {
  width: 100%;
  border-radius: 14px;
  height: 140px;
  object-fit: cover;
  background: var(--bg-soft);
}

.badge {
  font-size: 12px;
  color: var(--muted);
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

input,
select,
textarea {
  background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
}

textarea {
  resize: vertical;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-title {
  font-weight: 600;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  background: var(--bg-soft);
  padding: 12px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.family-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.profile-info {
  display: grid;
  gap: 10px;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-preview {
  width: 100%;
  min-height: 160px;
  border-radius: 16px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  padding: 10px;
}

.photo-preview img {
  width: 100%;
  border-radius: 16px;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.grow {
  flex: 1;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.modal.open {
  display: flex;
}

.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  width: min(520px, 100%);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 90vh;
}

.modal-card.wide {
  width: min(920px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding-right: 6px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-grid .modal-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.modal-body ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.footer {
  padding: 20px 32px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.muted {
  color: var(--muted);
}

.status {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
}

.tag {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 8px;
  border-radius: 999px;
}

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

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

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

  .family-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

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

  .toolbar-actions {
    width: 100%;
  }
}
