:root {
  color-scheme: light;
  --app-ink: #1d2a2b;
  --app-muted: #647174;
  --app-paper: #f4f6f4;
  --app-surface: #ffffff;
  --app-line: #dfe6e2;
  --app-accent: #27665e;
  --app-accent-dark: #1c514b;
  --app-accent-soft: #e7f0ed;
  --app-radius: 14px;
  --app-shadow: 0 12px 32px rgba(25, 45, 40, 0.06);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--app-paper);
  color: var(--app-ink);
  font-family: "Outfit", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

a {
  color: var(--app-accent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--app-accent-dark);
}

:focus-visible {
  outline: 3px solid rgba(39, 102, 94, 0.45);
  outline-offset: 3px;
}

.navbar {
  min-height: 68px;
  padding: 0.7rem 0;
  background: var(--app-surface) !important;
  border-bottom: 1px solid var(--app-line);
  box-shadow: none;
}

.navbar .container-fluid {
  max-width: 1480px;
  padding-inline: clamp(1rem, 4vw, 3rem);
}

.navbar-brand {
  color: var(--app-ink) !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.navbar-brand:hover {
  transform: none;
  color: var(--app-accent) !important;
}

.navbar-nav {
  gap: 0.2rem;
}

.navbar .nav-link {
  padding: 0.55rem 0.8rem;
  color: #4d5b5c !important;
  font-size: 0.94rem;
  font-weight: 500;
}

.navbar .nav-link::after {
  display: none;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus-visible {
  color: var(--app-accent-dark) !important;
}

.navbar-toggler {
  border-color: var(--app-line);
  box-shadow: none !important;
}

.navbar-text {
  color: var(--app-muted);
}

.app-page-container {
  max-width: 1480px;
  min-height: calc(100vh - 68px);
  padding: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 4vw, 3rem) 4rem;
}

.alert {
  max-width: 1360px;
  margin: 1.25rem auto 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: none;
  animation: none;
}

.btn {
  min-height: 42px;
  padding: 0.58rem 1rem;
  border-radius: 9px;
  font-weight: 600;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.btn-primary {
  color: #fff;
  background-color: var(--app-accent);
  border-color: var(--app-accent);
}

.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  background-color: var(--app-accent-dark);
  border-color: var(--app-accent-dark);
  box-shadow: 0 4px 12px rgba(28, 81, 75, 0.18);
}

.btn-outline-primary {
  color: var(--app-accent);
  border-color: #8aa8a1;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: var(--app-accent-dark);
  background-color: var(--app-accent-soft);
  border-color: var(--app-accent);
}

.btn-outline-danger {
  padding-inline: 0.9rem;
  border: 1px solid #d8aaa6 !important;
  border-radius: 9px;
  color: #9d3e37 !important;
  font-weight: 600;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  color: #fff !important;
  background: #a94139 !important;
  border-color: #a94139 !important;
  box-shadow: none;
  transform: none;
}

.card,
.modal-content {
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}

.card {
  height: 100%;
}

.card-body {
  padding: clamp(1.1rem, 2vw, 1.6rem);
}

.card-title,
.modal-title {
  color: var(--app-ink);
  font-weight: 600;
}

.card-text,
.text-muted {
  color: var(--app-muted) !important;
}

.form-group {
  margin-bottom: 1.1rem;
}

label,
.form-label {
  margin-bottom: 0.4rem;
  color: #334345;
  font-size: 0.92rem;
  font-weight: 600;
}

.form-control,
.form-select {
  min-height: 44px;
  padding: 0.62rem 0.8rem;
  border: 1px solid #cbd5d1;
  border-radius: 8px;
  background-color: #fff;
  color: var(--app-ink);
  box-shadow: none;
}

textarea.form-control {
  min-height: 7rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px rgba(39, 102, 94, 0.13);
}

.table-responsive {
  border: 1px solid var(--app-line);
  border-radius: 10px;
  background: #fff;
}

.table {
  margin-bottom: 0;
  color: var(--app-ink);
  vertical-align: middle;
}

.table > :not(caption) > * > * {
  padding: 0.8rem 0.9rem;
  border-bottom-color: var(--app-line);
}

.table thead th {
  background: #f1f5f2;
  color: #526061;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.045em;
}

.modal-content {
  overflow: hidden;
}

.modal-header,
.modal-footer {
  border-color: var(--app-line);
}

.modal .close {
  padding: 0 0.35rem;
  border: 0;
  background: transparent;
  color: var(--app-muted);
  font-size: 1.5rem;
}

canvas {
  max-width: 100%;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 500px) minmax(280px, 0.8fr);
  align-items: center;
  gap: clamp(2rem, 8vw, 8rem);
  max-width: 1080px;
  min-height: min(720px, calc(100vh - 180px));
  margin-inline: auto;
}

.auth-page-compact {
  min-height: auto;
  padding-block: 1rem;
}

.auth-card {
  width: 100%;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--app-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--app-shadow);
}

.auth-card h1 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.045em;
}

.auth-eyebrow,
.auth-aside > p {
  margin-bottom: 0.6rem;
  color: var(--app-accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-intro {
  margin-bottom: 1.8rem;
  color: var(--app-muted);
}

.signup-role-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: -0.55rem 0 1.4rem;
}

.signup-role-switch .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.auth-switch {
  margin: 1.3rem 0 0;
  color: var(--app-muted);
  font-size: 0.93rem;
}

.auth-aside {
  max-width: 430px;
}

.auth-aside > p {
  color: var(--app-muted);
}

.auth-aside h2 {
  max-width: 12ch;
  font-size: clamp(2rem, 4.2vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.home-page {
  padding-top: 0;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: center;
  gap: clamp(2.5rem, 7vw, 7rem);
  min-height: 520px;
  padding: clamp(3rem, 8vw, 7rem) 0;
}

.home-hero-copy {
  max-width: 700px;
}

.home-hero h1 {
  max-width: 12ch;
  margin-bottom: 1.2rem;
  font-size: clamp(3rem, 5vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 0.99;
}

.home-hero-copy > p {
  max-width: 58ch;
  margin-bottom: 1.8rem;
  color: var(--app-muted);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.home-hero-actions .btn {
  min-width: 132px;
}

.workflow-preview {
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid #d9e3de;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(39, 102, 94, 0.09), transparent 55%),
    #fff;
  box-shadow: 0 24px 55px rgba(25, 45, 40, 0.08);
}

.workflow-preview h2 {
  margin-bottom: 1.1rem;
  font-size: 1.12rem;
  font-weight: 600;
}

.workflow-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--app-line);
  color: var(--app-ink);
  font-weight: 500;
}

.workflow-item span:last-child {
  color: var(--app-muted);
  font-size: 0.88rem;
  font-weight: 400;
}

.home-section {
  padding: clamp(3.5rem, 7vw, 6.5rem) 0;
  border-top: 1px solid var(--app-line);
}

.home-section-heading {
  max-width: 660px;
  margin-bottom: 2rem;
}

.home-section-heading h2 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  font-weight: 600;
  letter-spacing: -0.05em;
}

.home-section-heading p {
  margin: 0;
  color: var(--app-muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 1rem;
}

.feature-card {
  min-height: 190px;
  padding: 1.5rem;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  background: #fff;
}

.feature-card h3 {
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.feature-card p {
  margin: 0;
  color: var(--app-muted);
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  padding: 0;
  list-style: none;
  counter-reset: workflow;
}

.workflow-steps li {
  padding: 1.3rem 0;
  border-top: 2px solid #a5bdb5;
  counter-increment: workflow;
}

.workflow-steps li::before {
  display: block;
  margin-bottom: 1.1rem;
  color: var(--app-accent);
  content: "0" counter(workflow);
  font-size: 0.9rem;
  font-weight: 600;
}

.workflow-steps h3 {
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.workflow-steps p {
  margin: 0;
  color: var(--app-muted);
}

.home-join {
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: 16px;
  background: #1e3432;
  color: #fff;
}

.home-join .home-section-heading h2,
.home-join .home-section-heading p {
  color: #fff;
}

.home-join .home-section-heading p {
  opacity: 0.78;
}

.join-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.join-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 178px;
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
}

.join-option h3 {
  margin-bottom: 0.4rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.join-option p {
  flex: 1;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.93rem;
}

.join-option .btn {
  margin-top: 0.5rem;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.65);
}

.join-option .btn:hover {
  color: #1e3432;
  background: #fff;
  border-color: #fff;
}

.landing-footer {
  margin: 2rem calc(-1 * clamp(1rem, 4vw, 3rem)) calc(-1 * clamp(1.5rem, 3vw, 3rem));
  padding: 1.6rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--app-line);
  background: transparent;
  color: var(--app-muted);
  text-align: left;
}

.landing-footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }

  .home-hero h1 {
    max-width: 14ch;
  }

  .auth-page {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    max-width: 560px;
    padding-block: 1rem;
  }

  .auth-aside {
    display: none;
  }
}

@media (max-width: 700px) {
  .app-page-container {
    padding-inline: 1rem;
  }

  .feature-grid,
  .workflow-steps,
  .join-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-card,
  .join-option {
    min-height: 0;
  }

  .home-join {
    margin-inline: -0.25rem;
    padding: 1.4rem;
  }

  .landing-footer {
    margin-inline: -1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.users-page {
  max-width: 1220px;
  margin-inline: auto;
}

.users-page-header,
.users-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
}

.users-page-header {
  margin-bottom: 1.75rem;
}

.users-page-header h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.055em;
}

.users-eyebrow {
  margin-bottom: 0.35rem;
  color: var(--app-accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.users-page-intro,
.users-section-heading p {
  margin: 0;
  color: var(--app-muted);
}

.users-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 2.2rem;
}

.users-overview-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 76px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--app-line);
  border-radius: 11px;
  background: #fff;
}

.users-overview-item span {
  color: var(--app-muted);
  font-size: 0.9rem;
}

.users-overview-item strong {
  color: var(--app-ink);
  font-size: 1.45rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.users-section {
  margin-top: 2.4rem;
}

.users-section-heading {
  margin-bottom: 1rem;
}

.users-section-heading h2 {
  margin-bottom: 0.3rem;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.users-section-heading p {
  font-size: 0.92rem;
}

.users-count,
.user-role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.28rem 0.62rem;
  border: 1px solid #d3e2dc;
  border-radius: 999px;
  background: var(--app-accent-soft);
  color: var(--app-accent-dark);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.users-count {
  min-width: 2rem;
  font-variant-numeric: tabular-nums;
}

.users-count-alert,
.user-role-flagged {
  border-color: #efd5d1;
  background: #fbefed;
  color: #963f37;
}

.user-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
  align-items: stretch;
  gap: 0.9rem;
}

.user-profile-card {
  min-width: 0;
  padding: 1.2rem;
  border: 1px solid var(--app-line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.user-profile-card:hover {
  transform: translateY(-2px);
  border-color: #b8cbc3;
  box-shadow: 0 14px 30px rgba(25, 45, 40, 0.08);
}

.user-profile-card-flagged {
  border-left: 3px solid #b94e43;
}

.user-profile-heading {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  margin-bottom: 1.1rem;
}

.user-avatar {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #e4efeb;
  color: var(--app-accent-dark);
  font-size: 1rem;
  font-weight: 600;
}

.user-avatar-sponsor {
  background: #e8ece7;
  color: #4a5d4c;
}

.user-avatar-flagged {
  background: #f8e9e7;
  color: #963f37;
}

.user-profile-heading h3 {
  overflow: hidden;
  margin: 0 0 0.28rem;
  color: var(--app-ink);
  font-size: 1.08rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-heading .user-role {
  font-size: 0.74rem;
}

.user-facts,
.creator-facts {
  display: grid;
  gap: 0;
  margin: 0 0 1.1rem;
}

.user-facts > div,
.creator-facts > div {
  display: grid;
  grid-template-columns: minmax(72px, 0.65fr) minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-top: 1px solid #edf0ee;
}

.user-facts dt,
.creator-facts dt {
  color: var(--app-muted);
  font-size: 0.84rem;
  font-weight: 400;
}

.user-facts dd,
.creator-facts dd {
  min-width: 0;
  margin: 0;
  color: var(--app-ink);
  font-size: 0.88rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.user-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.users-table-name {
  font-weight: 600;
}

.users-table-action {
  width: 1%;
  white-space: nowrap;
}

.users-empty,
.creator-empty-state {
  padding: 1.2rem;
  border: 1px dashed #cbd8d2;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--app-muted);
}

.users-empty {
  margin: 0;
}

.creator-search-panel {
  margin-bottom: 2rem;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--app-line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--app-shadow);
}

.creator-search-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 1.4fr) repeat(2, minmax(120px, 0.8fr));
  gap: 0.9rem;
}

.creator-search-field {
  min-width: 0;
}

.creator-search-field label {
  display: block;
}

.creator-search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.creator-results {
  margin-top: 0;
}

.creator-profile-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.creator-profile-card .creator-facts {
  width: 100%;
  flex: 1;
}

.creator-profile-card > .btn {
  margin-top: auto;
}

.creator-empty-state {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}

.creator-empty-state h2 {
  color: var(--app-ink);
  font-size: 1.3rem;
  font-weight: 600;
}

.creator-empty-state p {
  margin-bottom: 1.1rem;
}

.creator-modal-facts > div {
  grid-template-columns: 130px minmax(0, 1fr);
}

@media (max-width: 1000px) {
  .users-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 600px) {
  .users-page-header,
  .users-section-heading {
    align-items: flex-start;
  }

  .users-overview {
    gap: 0.55rem;
  }

  .users-overview-item {
    min-height: 68px;
    padding: 0.75rem;
  }

  .users-overview-item span {
    max-width: 10ch;
    font-size: 0.8rem;
  }

  .users-overview-item strong {
    font-size: 1.2rem;
  }

  .user-card-grid,
  .creator-search-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .creator-search-actions > .btn {
    flex: 1;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .user-profile-card {
    transition: none;
  }

  .user-profile-card:hover {
    transform: none;
  }
}
