:root {
  --primary: hsl(220 91% 50%);
  --primary-glow: hsl(220 91% 60%);
  --secondary: hsl(45 93% 58%);
  --accent: hsl(270 95% 75%);
  --church-navy: hsl(220 100% 25%);
  --church-light-blue: hsl(200 100% 95%);
  --church-cream: hsl(45 37% 97%);
  --surface: #ffffff;
  --surface-soft: #f5f8ff;
  --surface-hero: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(229, 246, 255, 0.92));
  --surface-card: linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(234, 243, 255, 0.96));
  --text: hsl(220 26% 14%);
  --muted: hsl(220 14% 46%);
  --line: rgba(15, 59, 146, 0.12);
  --shadow-soft: 0 10px 28px -18px rgba(15, 59, 146, 0.28);
  --shadow-glow: 0 18px 44px -22px rgba(15, 59, 146, 0.34);
  --shadow-gold: 0 12px 30px -20px rgba(243, 191, 48, 0.45);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Segoe UI", "Bahnschrift", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(37, 99, 235, 0.14), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f5f8ff 48%, #eef4ff 100%);
}

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

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

button,
input,
select {
  font: inherit;
}

button,
.ghost-button,
.secondary-button,
.primary-button,
.topnav a,
.team-chip,
.info-pill {
  border-radius: 999px;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

button:hover,
.ghost-button:hover,
.secondary-button:hover,
.primary-button:hover,
.topnav a:hover,
.team-chip:hover {
  transform: translateY(-1px);
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.topbar {
  position: sticky;
  top: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 16px 22px;
  border: 1px solid rgba(15, 59, 146, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
}

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

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: var(--shadow-glow);
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-kicker,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.74rem;
  color: hsl(45 93% 42%);
}

.brand-title {
  font-size: clamp(1.3rem, 2vw, 1.9rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.topnav a,
.team-chip,
.info-pill,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid rgba(15, 59, 146, 0.1);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.content-shell {
  display: grid;
  gap: 22px;
}

.hero-card,
.panel-card,
.toolbar-card,
.helper-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(15, 59, 146, 0.1);
  border-radius: var(--radius);
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
}

.hero-card::before,
.panel-card::before,
.toolbar-card::before,
.helper-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), transparent 45%);
  pointer-events: none;
}

.hero-card,
.toolbar-card,
.helper-card {
  padding: 30px;
}

.panel-card {
  padding: 24px;
}

.section-heading,
.hero-badges,
.panel-heading,
.planner-actions {
  position: relative;
  z-index: 1;
}

.section-heading h1,
.panel-heading h2 {
  margin: 8px 0 10px;
  line-height: 1.08;
}

.section-heading h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.section-heading p,
.panel-heading p,
.member-caption,
.slot-empty-copy span,
.empty-state,
.roster-copy span,
.member-editor-head span,
.helper-card,
label,
.site-footer span {
  color: var(--muted);
}

.hero-badges,
.planner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.stage-hero,
.admin-hero,
.auth-card {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 28%),
    radial-gradient(circle at top left, rgba(168, 85, 247, 0.11), transparent 22%),
    var(--surface-hero);
}

.auth-card {
  max-width: 780px;
  margin: 0 auto;
}

.stage-board {
  position: relative;
  padding: 34px 24px 28px;
  border-radius: 32px;
  border: 1px solid rgba(15, 59, 146, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(232, 243, 255, 0.98)),
    var(--surface-card);
  box-shadow: var(--shadow-glow);
}

.stage-rim {
  height: 8px;
  margin-bottom: 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
}

.mic-grid,
.admin-stage-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.mic-card,
.stage-slot,
.member-editor-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(15, 59, 146, 0.1);
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
}

.mic-card {
  padding: 18px 16px 20px;
  text-align: center;
}

.mic-card-empty {
  opacity: 0.88;
}

.mic-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.member-frame {
  width: 124px;
  height: 124px;
  margin: 18px auto 14px;
  padding: 6px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(168, 85, 247, 0.2));
}

.member-photo,
.member-editor-avatar,
.roster-avatar,
.slot-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
}

.member-name {
  font-size: 1.06rem;
  font-weight: 700;
}

.band-member-frame {
  width: 108px;
  height: 108px;
  margin-bottom: 12px;
}

.toolbar-form,
.planner-layout,
.form-grid,
.member-editor-grid {
  display: grid;
  gap: 16px;
}

.toolbar-form {
  grid-template-columns: repeat(4, minmax(0, auto));
  align-items: end;
}

.planner-layout {
  grid-template-columns: 320px minmax(0, 1fr);
}

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading h2 {
  font-size: 1.45rem;
}

.band-heading {
  margin-top: 10px;
}

.roster-list {
  display: grid;
  gap: 12px;
}

.roster-card,
.slot-member-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(15, 59, 146, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.roster-avatar {
  width: 62px;
  height: 62px;
}

.slot-photo {
  width: 64px;
  height: 64px;
}

.roster-copy,
.slot-member-card {
  min-width: 0;
}

.roster-copy {
  display: grid;
}

.stage-planner {
  display: grid;
  gap: 18px;
}

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

.band-slot-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(15, 59, 146, 0.1);
  border-radius: 24px;
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
}

.band-slot-empty {
  opacity: 0.9;
}

.band-slot-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.1);
  color: hsl(270 58% 48%);
  font-weight: 700;
}

.band-slot-body {
  min-height: 90px;
  display: grid;
  align-items: center;
}

.band-slot-member {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.stage-slot {
  padding: 16px;
  min-height: 280px;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.stage-slot.is-drop-target,
.stage-slot:hover,
.mic-card:hover,
.member-editor-card:hover {
  border-color: rgba(37, 99, 235, 0.22);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stage-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.slot-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  cursor: pointer;
}

.slot-canvas {
  display: grid;
  place-items: center;
  min-height: 146px;
  padding: 14px 0;
}

.slot-member-card {
  width: 100%;
}

.slot-member-card strong,
.roster-copy strong,
.member-editor-head strong {
  display: block;
  font-size: 1rem;
}

.slot-member-card span {
  color: var(--muted);
}

.slot-empty-copy {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.slot-select-wrap {
  display: grid;
  gap: 8px;
}

.slot-select,
input,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(15, 59, 146, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

input[type="file"] {
  padding: 10px 12px;
}

label {
  display: grid;
  gap: 8px;
}

.role-picker {
  display: grid;
  gap: 10px;
}

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

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 59, 146, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.role-chip input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.role-chip span {
  color: var(--text);
  font-weight: 600;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

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

.form-grid > .checkbox-row,
.form-grid > button {
  grid-column: 1 / -1;
}

.narrow-form {
  max-width: 520px;
}

.member-editor-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.member-editor-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.member-editor-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.member-editor-avatar {
  width: 72px;
  height: 72px;
}

.primary-button {
  padding: 12px 18px;
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  font-weight: 700;
  box-shadow: var(--shadow-glow);
}

.secondary-button {
  padding: 12px 18px;
  border: 0;
  background: linear-gradient(135deg, hsl(45 93% 58%), hsl(45 93% 68%));
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}

.ghost-button {
  border: 1px solid rgba(15, 59, 146, 0.1);
}

.team-chip {
  gap: 8px;
}

.team-chip-active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(168, 85, 247, 0.12));
  border-color: rgba(37, 99, 235, 0.16);
}

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

.service-link-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(15, 59, 146, 0.12);
  border-radius: 22px;
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
}

.service-link-card strong {
  font-size: 1rem;
  line-height: 1.3;
}

.service-link-card span {
  color: var(--muted);
}

.service-link-card:hover,
.service-link-card-active {
  border-color: rgba(37, 99, 235, 0.18);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.service-link-card-active {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 34%),
    var(--surface-card);
}

.service-link-day {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary) !important;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.selected-service-card {
  padding-bottom: 10px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-soft);
}

.flash-success {
  border-color: rgba(34, 197, 94, 0.18);
  background: rgba(220, 252, 231, 0.9);
}

.flash-error {
  border-color: rgba(239, 68, 68, 0.16);
  background: rgba(254, 242, 242, 0.92);
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(15, 59, 146, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 28px;
  padding: 22px 24px;
  border-radius: 24px;
  background: var(--church-navy);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.site-footer strong {
  display: block;
  margin-bottom: 4px;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer-links a {
  color: rgba(255, 255, 255, 0.82);
}

.site-footer {
  display: none !important;
}

[data-draggable-member="true"] {
  cursor: grab;
}

[data-draggable-member="true"]:active {
  cursor: grabbing;
}

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

  .admin-stage-grid,
  .mic-grid,
  .member-editor-grid,
  .band-slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 780px) {
  .page-shell {
    width: min(100% - 24px, 100%);
  }

  .topbar,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-card,
  .helper-card,
  .toolbar-card,
  .panel-card,
  .stage-board {
    padding-left: 18px;
    padding-right: 18px;
  }

  .mic-grid,
  .admin-stage-grid,
  .member-editor-grid,
  .form-grid,
  .band-slot-grid,
  .toolbar-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-checkbox-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .brand-mark {
    align-items: flex-start;
  }

  .mic-grid,
  .admin-stage-grid,
  .member-editor-grid,
  .form-grid,
  .band-slot-grid,
  .toolbar-form {
    grid-template-columns: 1fr;
  }

  .hero-badges,
  .planner-actions,
  .topnav,
  .site-footer-links {
    width: 100%;
  }
}
