:root {
  color-scheme: dark;
  --bg-1: #050816;
  --bg-2: #0b1230;
  --paper: rgba(11, 17, 42, 0.76);
  --paper-strong: rgba(15, 23, 55, 0.94);
  --line: rgba(151, 177, 255, 0.14);
  --ink: #f4f7ff;
  --muted: #9ca9d2;
  --accent: #62ddff;
  --accent-soft: rgba(98, 221, 255, 0.14);
  --copper: #ffb34d;
  --rose: #ff5fa2;
  --violet: #8e6bff;
  --shadow: 0 28px 90px rgba(2, 6, 23, 0.48);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 95, 162, 0.26), transparent 18%),
    radial-gradient(circle at 82% 10%, rgba(98, 221, 255, 0.24), transparent 24%),
    radial-gradient(circle at 55% 105%, rgba(142, 107, 255, 0.28), transparent 30%),
    linear-gradient(145deg, var(--bg-1) 0%, #0a1024 34%, var(--bg-2) 100%);
}

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

button {
  color: inherit;
}

.page-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 42px 18px 56px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: panel-rise 420ms ease both;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(98, 221, 255, 0.14), transparent 26%),
    radial-gradient(circle at bottom right, rgba(255, 95, 162, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 34%);
}

.hero-panel,
.control-panel,
.template-panel,
.composer-panel,
.board-panel,
.detail-panel,
.bookings-panel,
.recommend-panel,
.agent-panel,
.leaderboard-panel,
.admin-panel,
.resident-directory {
  padding: 24px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
  gap: 20px;
  padding: 26px 30px;
  align-items: center;
}

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

.hero-copy h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 0.98;
  letter-spacing: 0.02em;
  max-width: none;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.72rem;
  color: var(--accent);
}

.hero-text,
.directory-note,
.soft-copy,
.board-card-copy,
.detail-copy,
.match-card p,
.leader-card p,
.composer-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.hero-text {
  max-width: 58ch;
  margin-top: 16px;
  font-size: 1.02rem;
}

.hero-side {
  display: grid;
  align-content: start;
  gap: 16px;
}

.status-pill,
.mini-pill,
.type-pill,
.tag,
.hero-button,
.mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.status-pill,
.mini-pill,
.tag {
  padding: 8px 12px;
  border: 1px solid transparent;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.86rem;
}

.status-pill {
  width: fit-content;
  color: var(--accent);
  background: rgba(98, 221, 255, 0.14);
  border-color: rgba(98, 221, 255, 0.22);
}

.status-pill.error {
  color: var(--rose);
  background: rgba(255, 95, 162, 0.14);
  border-color: rgba(255, 95, 162, 0.22);
}

.mini-pill {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.06);
}

.mini-pill.subtle {
  color: var(--muted);
  background: rgba(151, 177, 255, 0.08);
}

.mini-pill.success {
  color: var(--accent);
  background: rgba(98, 221, 255, 0.14);
}

.hero-actions,
.composer-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-button,
.mini-action {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.hero-button {
  min-height: 48px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--accent), var(--violet) 58%, var(--rose) 100%);
  color: #08101f;
  font-weight: 700;
  box-shadow: 0 16px 40px rgba(98, 221, 255, 0.18);
}

.hero-button.ghost,
.mini-action {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-button:hover,
.mini-action:hover,
.board-card:hover {
  transform: translateY(-1px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.stat-card {
  padding: 18px 20px;
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-value {
  display: block;
  margin-top: 10px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

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

.control-panel,
.template-panel,
.composer-panel,
.workspace-grid,
.resident-directory {
  margin-top: 18px;
}

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

.section-head h2,
.detail-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.05;
}

.filters-grid,
.composer-grid {
  display: grid;
  gap: 14px;
}

.filters-grid {
  grid-template-columns: minmax(0, 2fr) repeat(5, minmax(0, 1fr));
  align-items: end;
}

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

.field,
.checkbox-field {
  display: grid;
  gap: 8px;
}

.field span,
.checkbox-field span {
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.88rem;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-strong);
  color: var(--ink);
  padding: 15px 16px;
  outline: none;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(156, 169, 210, 0.72);
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(98, 221, 255, 0.42);
  box-shadow: 0 0 0 4px rgba(98, 221, 255, 0.12);
}

.field-wide {
  grid-column: span 2;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 22px;
}

.filters-grid .checkbox-field {
  grid-column: 1 / -1;
  padding-top: 0;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 18px;
}

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

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

.template-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(14, 21, 50, 0.88);
  padding: 16px;
  display: grid;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.template-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.resident-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(14, 21, 50, 0.88);
  padding: 16px;
  display: grid;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.resident-card-top,
.booking-head,
.action-stack,
.inline-form-actions,
.admin-metric-grid {
  display: flex;
  gap: 10px;
}

.resident-card-top,
.booking-head {
  align-items: flex-start;
}

.action-stack {
  flex-direction: column;
  align-items: flex-end;
}

.sidebar-stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

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

.board-card,
.match-card,
.leader-card,
.empty-card,
.booking-card,
.metric-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(14, 21, 50, 0.88);
}

.board-card {
  width: 100%;
  padding: 18px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 12px;
}

.board-card.active {
  border-color: rgba(98, 221, 255, 0.34);
  background:
    linear-gradient(180deg, rgba(98, 221, 255, 0.1), rgba(14, 21, 50, 0.92)),
    rgba(14, 21, 50, 0.88);
}

.board-card-top,
.board-card-footer,
.board-card-meta,
.detail-meta,
.tag-row,
.resident-topline,
.section-inline-head {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.board-card-top,
.board-card-footer,
.section-inline-head {
  justify-content: space-between;
}

.board-card h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.15;
}

.board-card-meta,
.resident-thread,
.fit-note,
.match-label {
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.board-card-meta,
.resident-thread,
.fit-note {
  color: var(--muted);
  font-size: 0.84rem;
}

.resident-thread {
  margin: 0;
}

.type-pill {
  padding: 7px 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.72rem;
}

.type-pill.ask {
  background: rgba(255, 179, 77, 0.16);
  color: #ffd18f;
}

.type-pill.offer {
  background: rgba(98, 221, 255, 0.16);
  color: var(--accent);
}

.tag {
  background: rgba(255, 255, 255, 0.08);
}

.tag.muted {
  color: var(--muted);
  background: rgba(151, 177, 255, 0.08);
}

.detail-panel,
.bookings-panel,
.recommend-panel,
.agent-panel,
.leaderboard-panel,
.admin-panel {
  min-height: 240px;
}

.detail-header,
.detail-section {
  display: grid;
  gap: 14px;
}

.detail-header {
  align-items: start;
  grid-template-columns: minmax(0, 1fr) auto;
}

.detail-copy {
  font-size: 1rem;
}

.detail-section {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-section h3 {
  margin: 0;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list p {
  margin: 0;
  line-height: 1.6;
}

.match-card,
.leader-card {
  padding: 14px 15px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.match-card strong,
.leader-card strong,
.resident-topline strong {
  display: block;
  margin-bottom: 4px;
}

.match-label {
  margin: 0 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper);
}

.recommend-panel,
.leaderboard-panel {
  display: grid;
  gap: 12px;
}

.recommendation-card,
.leader-card {
  margin-top: 10px;
}

.booking-card {
  padding: 14px 15px;
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.empty-card {
  padding: 24px;
}

.resident-panel {
  background: linear-gradient(180deg, rgba(98, 221, 255, 0.08), rgba(14, 21, 50, 0.9));
  border-radius: var(--radius-lg);
  padding: 18px;
}

.resident-topline {
  align-items: flex-start;
}

.avatar-shell {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(98, 221, 255, 0.36), rgba(142, 107, 255, 0.34), rgba(255, 95, 162, 0.34));
  font-size: 1.8rem;
}

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

.avatar-shell.small {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  font-size: 1.2rem;
  flex: 0 0 auto;
}

.portfolio-link {
  display: inline-flex;
  margin-right: 10px;
  color: var(--accent);
  text-decoration: none;
}

.portfolio-link.inert {
  color: var(--muted);
}

.mini-action {
  min-height: 34px;
  padding: 0 12px;
}

.mini-action.danger {
  background: rgba(255, 95, 162, 0.14);
  color: #ffc1d9;
}

.action-row,
.review-grid {
  display: grid;
  gap: 10px;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.inline-form-actions {
  align-items: center;
  grid-column: 1 / -1;
  flex-wrap: wrap;
}

.review-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.review-details summary {
  cursor: pointer;
  color: var(--accent);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.review-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(18, 28, 64, 0.86);
  border: 1px solid rgba(98, 221, 255, 0.12);
}

.review-card p {
  margin: 0;
  line-height: 1.55;
}

.metric-chip {
  padding: 14px;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.metric-chip strong {
  font-size: 1.4rem;
}

.metric-chip span {
  color: var(--muted);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-size: 0.85rem;
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .hero-panel,
  .workspace-grid,
  .stats-grid,
  .filters-grid,
  .template-list,
  .board-list,
  .resident-list,
  .inline-form {
    grid-template-columns: 1fr;
  }

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

  .field-wide {
    grid-column: span 1;
  }

  .checkbox-field {
    padding-top: 6px;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 18px 14px 36px;
  }

  .hero-panel,
  .control-panel,
  .template-panel,
  .composer-panel,
  .board-panel,
  .detail-panel,
  .bookings-panel,
  .recommend-panel,
  .agent-panel,
  .leaderboard-panel,
  .admin-panel,
  .resident-directory {
    padding: 18px;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .detail-header {
    grid-template-columns: 1fr;
  }

  .match-card,
  .leader-card,
  .resident-card-top,
  .booking-head,
  .admin-metric-grid {
    flex-direction: column;
  }
}
