:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #c13584;
  --brand-2: #405de6;
  --brand-3: #f77737;
  --blue: #1877f2;
  --green: #12805c;
  --red: #b4233a;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.11);
  --soft-shadow: 0 8px 24px rgba(16, 24, 40, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #ffffff 0, rgba(255, 255, 255, 0) 280px),
    radial-gradient(circle at 10% 0%, rgba(193, 53, 132, 0.12), transparent 30%),
    radial-gradient(circle at 90% 4%, rgba(24, 119, 242, 0.12), transparent 32%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  overflow: hidden;
  font-size: clamp(1.15rem, 3vw, 1.7rem);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.12rem;
}

h3 {
  margin-bottom: 2px;
  font-size: 1.05rem;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.app-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(228, 231, 236, 0.88);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

.brand-button {
  min-height: auto;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.brand-mark,
.avatar,
.mini-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand), var(--brand-3));
  color: #fff;
  font-weight: 950;
}

.brand-mark {
  width: 48px;
  height: 48px;
}

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

.eyebrow {
  margin: 0 0 2px;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f1f5f9;
}

.tab,
button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
}

button {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  box-shadow: 0 8px 18px rgba(64, 93, 230, 0.18);
}

.tab {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.08);
}

.home-view,
.planner-view {
  display: grid;
  gap: 16px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 22px;
  align-items: center;
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(64, 93, 230, 0.11), rgba(193, 53, 132, 0.09)),
    var(--surface);
  box-shadow: var(--shadow);
}

.home-hero h2 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(1.75rem, 5vw, 3.7rem);
  line-height: 1.02;
}

.home-hero p:not(.eyebrow) {
  max-width: 650px;
  margin-bottom: 0;
  color: #475467;
  font-size: 1.02rem;
  line-height: 1.55;
}

.quick-create,
.form-block,
.main-panel,
.event-section {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--soft-shadow);
}

.quick-create {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.join-event {
  display: flex;
  gap: 12px;
  align-items: end;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.join-event label {
  flex: 1;
}

.event-section {
  padding: 16px;
}

.section-heading,
.hero-band,
.panel-heading,
.post-header,
.event-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading p,
.meta-line,
.panel-heading p,
.status,
.stats-grid em,
.card-meta,
.log-meta,
.form-heading p,
.event-card span {
  color: var(--muted);
}

.status {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(18, 128, 92, 0.1);
  color: var(--green);
  padding: 0 12px;
  font-size: 0.86rem;
  font-weight: 900;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.event-card {
  display: grid;
  gap: 16px;
  min-height: 190px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  padding: 16px;
  text-align: left;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.04);
}

.event-card:hover {
  border-color: rgba(64, 93, 230, 0.36);
  box-shadow: var(--soft-shadow);
}

.event-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 1rem;
}

.event-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.event-card-stats span {
  min-width: 0;
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 10px;
  font-size: 0.76rem;
  font-weight: 850;
}

.event-card-stats strong {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.2rem;
}

.open-event {
  color: var(--blue);
  font-size: 0.9rem;
  font-weight: 950;
}

.hero-band {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--soft-shadow);
}

.ghost-button {
  min-width: 86px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
  box-shadow: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stats-grid article {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
  box-shadow: var(--soft-shadow);
}

.stats-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.stats-grid strong {
  display: block;
  font-size: 1.45rem;
}

.stats-grid em {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  font-style: normal;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.side-panel {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
}

.main-panel {
  min-width: 0;
  overflow: hidden;
}

.panel-heading {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading p {
  margin-bottom: 0;
}

.form-block {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.form-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-heading p {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.mini-avatar {
  width: 38px;
  height: 38px;
}

.settings-card {
  gap: 0;
}

.settings-card summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 950;
}

.settings-form {
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 0.86rem;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(64, 93, 230, 0.55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(64, 93, 230, 0.12);
}

textarea {
  resize: vertical;
}

.cards {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.04);
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.card:hover {
  box-shadow: var(--soft-shadow);
  transform: translateY(-1px);
}

.card.finalized {
  border-color: rgba(18, 128, 92, 0.35);
  background: linear-gradient(180deg, #ffffff, #f5fbf8);
}

.avatar {
  width: 44px;
  height: 44px;
  font-size: 0.9rem;
}

.avatar.small {
  width: 34px;
  height: 34px;
  font-size: 0.78rem;
}

.post-header span {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  font-weight: 750;
}

.post-body p {
  margin: 12px 0 0;
  color: #344054;
  line-height: 1.45;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 10px;
  font-size: 0.86rem;
}

.dancer-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
}

.dancer-group select {
  width: auto;
  min-width: 160px;
  max-width: 100%;
  padding: 8px 34px 8px 10px;
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 0.86rem;
  font-weight: 750;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #fce7f3;
  color: #9d174d;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 950;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.card-actions a,
.secondary,
.danger,
.destructive {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  padding: 0 12px;
  text-decoration: none;
  font-weight: 900;
  box-shadow: none;
}

.card-actions .open-reference {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.card-actions .secondary,
.card-actions .destructive {
  border-color: transparent;
  background: transparent;
  padding: 0 7px;
}

.card-actions .destructive {
  color: var(--red);
}

.danger {
  border-color: rgba(18, 128, 92, 0.18);
  background: rgba(18, 128, 92, 0.1);
  color: var(--green);
}

.empty {
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
  padding: 34px;
  color: var(--muted);
  text-align: center;
  font-weight: 850;
}

.empty.large {
  grid-column: 1 / -1;
}

.practice-view {
  padding: 16px;
}

.practice-form {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input {
  width: auto;
}

.logs {
  display: grid;
  gap: 10px;
}

.log {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 12px;
}

.log p {
  margin-bottom: 0;
}

.hidden {
  display: none;
}

.auth-view {
  min-height: 65vh;
  display: grid;
  place-items: center;
}

.auth-view.hidden {
  display: none;
}

.auth-card {
  width: min(100%, 430px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card > p:not(.eyebrow):not(.status) {
  color: var(--muted);
}

.auth-form,
.auth-actions {
  display: grid;
  gap: 12px;
}

.auth-actions {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 980px) {
  .app-nav,
  .home-hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }

  .tabs {
    width: 100%;
  }

  .event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid,
  .practice-form,
  .join-event {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 10px;
  }

  .section-heading,
  .hero-band,
  .panel-heading,
  .post-header {
    align-items: stretch;
    flex-direction: column;
  }

  .event-grid,
  .stats-grid,
  .practice-form,
  .join-event {
    grid-template-columns: 1fr;
  }

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

  .card-actions {
    align-items: stretch;
  }

  .dancer-group {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .dancer-group select {
    width: 100%;
  }
}
