:root{
  --bg: #f7f4ef;
  --panel: rgba(255,255,255,.84);
  --panel-strong: #fffdf9;
  --text: #17161a;
  --muted: #6f6a72;
  --line: rgba(23,22,26,.12);
  --line-strong: rgba(23,22,26,.18);
  --accent: #138a6a;
  --accent-strong: #0c7258;
  --accent-soft: rgba(19,138,106,.10);
  --danger: #a63b4a;
  --shadow: 0 24px 60px rgba(23,22,26,.08);
}

*{
  box-sizing: border-box;
}

html, body{
  min-height: 100%;
}

body{
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 12% 0%, rgba(166,59,74,.14), transparent 58%),
    radial-gradient(860px 500px at 100% 8%, rgba(19,138,106,.12), transparent 54%),
    linear-gradient(180deg, #fbf8f4 0%, #f4efe8 100%);
}

.admin-shell{
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.admin-topbar{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-branding{
  display: grid;
  gap: 4px;
}

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-title{
  margin: 0;
  font-size: clamp(34px, 5.3vw, 60px);
  line-height: .95;
  letter-spacing: -.04em;
}

.admin-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
.link-button{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.72);
  box-shadow: 0 8px 24px rgba(23,22,26,.04);
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}

.button:hover,
.link-button:hover,
.button:focus-visible,
.link-button:focus-visible{
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(23,22,26,.08);
  border-color: rgba(23,22,26,.24);
}

.button-primary{
  background: linear-gradient(180deg, #19a07a 0%, var(--accent) 100%);
  color: #ffffff;
  border-color: transparent;
}

.button-danger{
  color: var(--danger);
}

.button-soft{
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(19,138,106,.18);
}

.icon-button{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.84);
  color: var(--text);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.panel{
  border: 1px solid rgba(255,255,255,.72);
  background: var(--panel);
  backdrop-filter: blur(22px);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.profile-hero{
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 28px;
  margin-bottom: 22px;
}

.profile-avatar-wrap{
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-shell{
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 999px;
  overflow: hidden;
  border: 4px solid rgba(255,255,255,.8);
  background:
    radial-gradient(120px 90px at 24% 16%, rgba(255, 177, 208, .28), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,243,247,.92));
  box-shadow:
    0 18px 38px rgba(23,22,26,.10),
    inset 0 1px 0 rgba(255,255,255,.95);
}

.profile-avatar-image{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-fallback{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #b14a68;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -.05em;
}

.profile-copy{
  min-width: 0;
}

.profile-name{
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
  letter-spacing: -.04em;
}

.profile-lead{
  margin: 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.message-preview{
  margin-top: 18px;
  max-width: 520px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(214, 84, 121, .18);
  background:
    radial-gradient(220px 120px at 0% 0%, rgba(255, 170, 197, .22), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,245,248,.82));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.message-preview-label{
  display: inline-flex;
  margin-bottom: 8px;
  color: #b14a68;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.message-preview-body{
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.profile-hero-actions{
  display: flex;
  align-items: center;
}

.avatar-editor{
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(220px 120px at 0% 0%, rgba(255, 179, 205, .12), transparent 58%),
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,248,250,.9));
}

.avatar-editor-title{
  margin: 6px 0 4px;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -.03em;
}

.avatar-editor-subtitle{
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.avatar-editor-stage{
  display: flex;
  justify-content: center;
}

.avatar-preview-frame{
  position: relative;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  overflow: hidden;
  background:
    radial-gradient(180px 120px at 18% 12%, rgba(255, 177, 208, .18), transparent 58%),
    linear-gradient(180deg, #f6edea 0%, #ece2df 100%);
  border: 1px solid rgba(23,22,26,.12);
  box-shadow:
    inset 0 0 0 12px rgba(255,255,255,.24),
    0 12px 32px rgba(23,22,26,.08);
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.avatar-action-button{
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.avatar-action-button:hover,
.avatar-action-button:focus-visible{
  opacity: 1;
}

.avatar-action-mask{
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(23,22,26,.20);
  opacity: 0;
  transition: opacity .18s ease;
}

.avatar-action-symbol{
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255,255,255,.88);
  color: var(--text);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 10px 28px rgba(23,22,26,.14);
}

.avatar-preview-frame:hover .avatar-action-mask,
.avatar-preview-frame:focus-within .avatar-action-mask,
.avatar-preview-frame:hover .avatar-action-symbol,
.avatar-preview-frame:focus-within .avatar-action-symbol{
  opacity: 1;
}

.avatar-preview-frame.is-dragging{
  cursor: grabbing;
}

.avatar-preview-image{
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
}

.avatar-preview-fallback{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
}

.avatar-editor-controls{
  display: grid;
  gap: 14px;
}

.events-shell{
  padding: 26px;
}

.timeline-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.section-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.section-title{
  margin: 6px 0 4px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  letter-spacing: -.03em;
}

.section-subtitle{
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.timeline-list{
  display: grid;
  gap: 26px;
}

.timeline-year{
  display: grid;
  gap: 18px;
}

.timeline-year-title{
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  letter-spacing: -.04em;
}

.timeline-month{
  display: grid;
  gap: 14px;
}

.timeline-month-title{
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.timeline-month-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
  gap: 14px;
}

.event-card{
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-strong);
  overflow: hidden;
  min-height: 180px;
}

.event-card-main{
  min-width: 0;
}

.event-card-title{
  margin: 0;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.1;
  letter-spacing: -.03em;
  word-break: break-word;
}

.event-card-summary{
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 15px;
}

.event-meta-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-chip{
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #faf7f2;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.meta-chip.is-accent{
  background: rgba(19,138,106,.08);
  color: var(--accent-strong);
  border-color: rgba(19,138,106,.18);
}

.meta-chip.is-hidden{
  background: rgba(166,59,74,.08);
  color: var(--danger);
  border-color: rgba(166,59,74,.15);
}

.event-card-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.event-price{
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.event-price-caption{
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.event-action-stack{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.icon-action{
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.84);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.icon-action:hover,
.icon-action:focus-visible{
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(23,22,26,.08);
}

.icon-action svg{
  width: 22px;
  height: 22px;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-action.is-edit{
  border-color: rgba(19,138,106,.18);
  background: rgba(19,138,106,.08);
  color: var(--accent-strong);
}

.icon-action.is-edit svg{
  stroke: var(--accent-strong);
}

.icon-action.is-delete{
  border-color: rgba(166,59,74,.15);
  color: var(--danger);
}

.icon-action.is-delete svg{
  stroke: var(--danger);
}

.form-grid{
  display: grid;
  gap: 14px;
}

.field{
  display: grid;
  gap: 6px;
}

.field span{
  font-weight: 700;
}

.field input,
.field textarea,
.field select{
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #fffdfa;
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
  line-height: 1.4;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.field textarea{
  min-height: 132px;
  resize: vertical;
}

.field-inline{
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-inline input{
  width: auto;
}

.status-message{
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.status-message.is-error{
  color: var(--danger);
}

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

.overlay{
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
}

.overlay[hidden]{
  display: none;
}

.overlay-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(23,22,26,.38);
  backdrop-filter: blur(6px);
}

.overlay-panel{
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(88vh, 920px);
  padding: 24px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 24px;
  background: rgba(250,247,242,.96);
  box-shadow: 0 22px 58px rgba(23,22,26,.16);
  overflow-y: auto;
}

.overlay-panel-compact{
  width: min(460px, 100%);
}

.overlay-head{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.overlay-head h2{
  margin: 6px 0 0;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.03em;
}

.success-panel{
  text-align: center;
}

.success-illustration{
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.success-plane{
  width: 116px;
  height: 116px;
}

.success-plane circle{
  fill: rgba(19,138,106,.08);
  stroke: rgba(19,138,106,.18);
  stroke-width: 2;
}

.success-plane path{
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-plane path:first-of-type{
  fill: rgba(19,138,106,.18);
}

.success-copy{
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.unsaved-actions{
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

@media (max-width: 980px){
  .admin-shell{
    width: min(100% - 28px, 760px);
  }

  .profile-hero,
  .event-card{
    grid-template-columns: 1fr;
  }

  .profile-hero-actions{
    width: 100%;
  }

  .profile-avatar-wrap{
    justify-content: flex-start;
  }

  .overlay{
    padding: 14px;
  }

  .overlay-panel{
    width: min(680px, 100%);
    max-height: calc(100vh - 28px);
  }
}

@media (max-width: 640px){
  .admin-shell{
    width: calc(100% - 20px);
    padding-top: 18px;
  }

  .admin-topbar,
  .section-head{
    flex-direction: column;
    align-items: stretch;
  }

  .events-shell,
  .profile-hero{
    padding: 18px;
  }

  .event-card,
  .timeline-actions .button{
    width: 100%;
  }

  .button,
  .link-button{
    width: 100%;
  }

  .timeline-month-grid{
    grid-template-columns: 1fr;
  }

  .avatar-preview-frame{
    width: min(240px, calc(100vw - 96px));
    height: min(240px, calc(100vw - 96px));
  }
}
