:root {
  color-scheme: light;
  --bg: #f6f1e7;
  --panel: rgba(255, 250, 243, 0.82);
  --panel-strong: #fffdf9;
  --text: #183127;
  --text-strong: #10241c;
  --muted: #6c746d;
  --line: rgba(24, 49, 39, 0.12);
  --line-strong: rgba(24, 49, 39, 0.22);
  --brand: #1c5a45;
  --brand-dark: #154434;
  --accent: #d87747;
  --accent-soft: rgba(216, 119, 71, 0.14);
  --danger: #9d422b;
  --danger-bg: rgba(157, 66, 43, 0.12);
  --success-bg: rgba(53, 126, 91, 0.12);
  --shadow: 0 24px 56px rgba(42, 32, 16, 0.14);
  --shadow-soft: 0 18px 36px rgba(42, 32, 16, 0.08);
  --radius-xl: 28px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(250, 202, 158, 0.34), transparent 28%),
    radial-gradient(circle at top right, rgba(95, 145, 117, 0.22), transparent 26%),
    linear-gradient(180deg, #f8f3ea 0%, #f1e8da 46%, #f6f1e7 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
}

body::before {
  width: 320px;
  height: 320px;
  top: 90px;
  left: -120px;
  background: rgba(216, 119, 71, 0.11);
}

body::after {
  width: 360px;
  height: 360px;
  right: -80px;
  bottom: -120px;
  background: rgba(28, 90, 69, 0.11);
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

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

h1,
h2,
.brand-name,
.auth-showcase h1 {
  font-family: "Fraunces", "IBM Plex Serif", Georgia, serif;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.7rem;
  line-height: 1.1;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 72px;
  min-height: 100vh;
}

.site-header,
.section-header,
.top-nav,
.actions,
.nav-links,
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header {
  position: relative;
  z-index: 40;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 252, 247, 0.72);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  animation: rise-in 520ms ease both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-strong);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand) 0%, #2d7b5c 70%, #83a883 100%);
  color: #fffdf7;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 24px rgba(28, 90, 69, 0.22);
}

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

.brand-name {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
}

.brand-subtle,
.subtle {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.top-nav {
  position: relative;
  flex-wrap: wrap;
}

.nav-links {
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text);
  font-weight: 600;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.48);
  border-color: var(--line);
  transform: translateY(-1px);
}

.user-menu {
  position: relative;
}

.user-menu summary {
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu > .popover {
  display: none;
}

.user-menu[open] > .popover {
  display: grid;
}

.page {
  display: grid;
  gap: 28px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 32px;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(24, 80, 61, 0.98) 0%, rgba(40, 99, 76, 0.95) 56%, rgba(216, 119, 71, 0.78) 100%);
  box-shadow: 0 28px 64px rgba(42, 32, 16, 0.18);
  color: #fffdf7;
  animation: rise-in 560ms ease both;
}

.page-hero::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  top: -92px;
  right: -64px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.page-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  left: 38%;
  bottom: -140px;
  background: rgba(255, 228, 194, 0.16);
  border-radius: 50%;
}

.page-hero > * {
  position: relative;
  z-index: 1;
}

.hero-copy {
  display: grid;
  gap: 10px;
  max-width: 780px;
}

.eyebrow,
.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 800;
}

.eyebrow {
  color: rgba(255, 244, 228, 0.78);
}

.section-kicker {
  margin-bottom: 6px;
  color: var(--accent);
}

.page-hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 0.98;
  color: #fffdf7;
}

.lead {
  max-width: 680px;
  color: rgba(255, 248, 238, 0.82);
  font-size: 1.05rem;
  line-height: 1.7;
}

.page-hero .button-ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #fffdf7;
  border-color: rgba(255, 255, 255, 0.2);
}

.page-hero .button-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fffdf7;
  border-color: rgba(255, 255, 255, 0.34);
}

.card,
.auth-card,
.stat-card {
  min-width: 0;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.card,
.stat-card {
  padding: 28px;
  animation: rise-in 620ms ease both;
}

.card h2,
.auth-card h2,
.auth-card h1,
.section-header h2,
.stat-value {
  color: var(--text-strong);
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.92) 0%, rgba(252, 246, 237, 0.9) 100%);
}

.stat-card::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  left: -10%;
  bottom: 0;
  border-radius: 50%;
  background: var(--accent-soft);
}

.stat-card > * {
  position: relative;
  z-index: 1;
}

.stat-label {
  margin-bottom: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
}

.stat-value {
  margin-bottom: 8px;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
}

.stat-hint {
  max-width: 22ch;
}

.stack-lg,
.stack-md {
  display: grid;
}

.stack-lg {
  gap: 20px;
}

.stack-md {
  gap: 14px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 24px;
  align-items: start;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--text-strong);
  font-weight: 700;
}

.field span {
  font-size: 0.95rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(16, 36, 28, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 15px 16px;
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease,
    transform 140ms ease;
}

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

.field input::placeholder,
.field textarea::placeholder {
  color: #8a918a;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 0;
  border-color: rgba(28, 90, 69, 0.42);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 4px rgba(28, 90, 69, 0.08);
  transform: translateY(-1px);
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(16, 36, 28, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}

.checkbox-field span {
  color: var(--text-strong);
  font-weight: 600;
  line-height: 1.5;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: #fffdf8;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 16px 28px rgba(28, 90, 69, 0.18);
  transition:
    background-color 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.button:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(28, 90, 69, 0.22);
}

.button-ghost {
  background: rgba(255, 255, 255, 0.56);
  color: var(--text-strong);
  border: 1px solid rgba(16, 36, 28, 0.12);
  box-shadow: none;
}

.button-ghost:hover {
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-strong);
  border-color: rgba(16, 36, 28, 0.2);
}

.user-menu[open] > .user-trigger {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(16, 36, 28, 0.2);
}

.button-full {
  width: 100%;
}

.flash {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 22px;
  background: rgba(255, 250, 243, 0.76);
  box-shadow: var(--shadow-soft);
  animation: rise-in 600ms ease both;
}

.flash-success {
  background: linear-gradient(135deg, rgba(255, 250, 243, 0.84), rgba(235, 246, 239, 0.92));
}

.flash-error {
  background: linear-gradient(135deg, rgba(255, 250, 243, 0.84), rgba(251, 235, 230, 0.92));
  border-color: rgba(157, 66, 43, 0.16);
}

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

.flash-title {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 800;
}

.flash-message {
  color: var(--text-strong);
  line-height: 1.5;
}

.flash-dismiss {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  bottom: -80px;
  background: rgba(28, 90, 69, 0.08);
  border-radius: 50%;
}

.step-list {
  counter-reset: step;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.step-list li {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 16px 18px 16px 70px;
  border: 1px solid rgba(16, 36, 28, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
  line-height: 1.55;
}

.step-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 50%;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), #2d7b5c);
  color: #fffdf7;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 12px 20px rgba(28, 90, 69, 0.16);
}

.section-header {
  gap: 20px;
}

.section-header > div {
  display: grid;
  gap: 4px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(16, 36, 28, 0.09);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.52);
}

table,
.data-table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid rgba(16, 36, 28, 0.08);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 800;
}

tbody tr {
  transition: background-color 140ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.48);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.row-title {
  color: var(--text-strong);
  font-weight: 700;
}

.inline-link {
  color: var(--brand-dark);
  font-weight: 700;
}

.inline-link:hover {
  color: var(--brand);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-actions form {
  margin: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(28, 90, 69, 0.1);
  color: var(--brand-dark);
  white-space: nowrap;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.status-pill-danger {
  background: rgba(157, 66, 43, 0.12);
  color: #8f3925;
}

.status-pill-danger::before {
  background: #c45a3e;
}

.popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  min-width: 240px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 20px;
  background: rgba(255, 250, 243, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  display: grid;
  gap: 12px;
}

.popover-label {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.user-trigger {
  min-width: 200px;
  justify-content: center;
  cursor: pointer;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
}

.empty-state {
  padding: 14px 0 4px;
}

.auth-page {
  display: grid;
  place-items: center;
  min-height: min(72vh, 760px);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 460px);
  gap: 24px;
  align-items: stretch;
}

.auth-showcase {
  position: relative;
  overflow: hidden;
  padding: 36px;
  border-radius: 34px;
  background: linear-gradient(155deg, rgba(21, 68, 52, 0.98) 0%, rgba(40, 99, 76, 0.94) 52%, rgba(216, 119, 71, 0.74) 100%);
  box-shadow: 0 28px 64px rgba(42, 32, 16, 0.2);
  color: #fffdf7;
  display: grid;
  gap: 24px;
  animation: rise-in 540ms ease both;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -80px;
  bottom: -72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.auth-showcase > * {
  position: relative;
  z-index: 1;
}

.auth-showcase h1 {
  max-width: 10ch;
  color: #fffdf7;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 0.96;
}

.auth-showcase .lead {
  max-width: 56ch;
}

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

.auth-feature {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
}

.auth-feature h2 {
  color: #fffdf7;
  font-size: 1rem;
  line-height: 1.3;
}

.auth-feature p {
  color: rgba(255, 248, 238, 0.78);
  font-size: 0.94rem;
  line-height: 1.55;
}

.auth-card {
  max-width: none;
  margin: 0;
  padding: 32px;
  display: grid;
  gap: 24px;
  background: rgba(255, 250, 243, 0.86);
  animation: rise-in 620ms ease both;
}

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

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

.summary-block {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
}

.summary-label {
  margin-bottom: 6px;
  color: rgba(255, 248, 238, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
}

.summary-value {
  color: #fffdf7;
  font-weight: 700;
  line-height: 1.4;
}

.auth-footer {
  margin-top: 12px;
}

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

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

@media (max-width: 960px) {
  .app-shell {
    padding: 18px 18px 56px;
  }

  .site-header,
  .page-hero,
  .auth-showcase,
  .card,
  .stat-card,
  .auth-card {
    border-radius: 24px;
  }

  .dashboard-grid,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    gap: 18px;
  }

  .auth-feature-list,
  .invite-summary {
    grid-template-columns: 1fr;
  }

  .auth-showcase h1 {
    max-width: none;
  }
}

@media (max-width: 800px) {
  .site-header,
  .page-hero,
  .top-nav,
  .actions,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .top-nav {
    gap: 12px;
  }

  .nav-links {
    width: 100%;
    justify-content: stretch;
  }

  .nav-link {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
  }

  .user-trigger {
    width: 100%;
    min-width: 0;
  }

  .popover {
    position: static;
    min-width: 0;
  }

  .card,
  .stat-card,
  .auth-card {
    padding: 22px;
  }

  th,
  td {
    padding: 13px 14px;
  }

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

@media (max-width: 560px) {
  .brand-name {
    font-size: 1.2rem;
  }

  .page-hero {
    padding: 26px 22px;
  }

  .page-hero h1,
  .auth-showcase h1 {
    font-size: 2.2rem;
  }

  .stat-value {
    font-size: 2rem;
  }

  .step-list li {
    padding: 16px 16px 16px 62px;
  }
}
