:root {
  --ink: #202124;
  --muted: #6f7378;
  --line: #dde2e6;
  --surface: #ffffff;
  --soft: #f6f8f9;
  --green: #167a5a;
  --green-soft: #e5f5ee;
  --blue: #255fa8;
  --blue-soft: #e7f0fb;
  --amber: #a76b16;
  --amber-soft: #fff4df;
  --coral: #b54832;
  --coral-soft: #ffebe5;
  --shadow: 0 18px 45px rgba(31, 35, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost,
.segmented button,
.tabs button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.ghost:hover,
.segmented button:hover,
.tabs button:hover {
  border-color: #bac3ca;
}

.primary {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 700;
}

.primary:hover {
  background: #10694d;
}

.danger {
  color: #fff;
  background: var(--coral);
}

.secondary {
  color: var(--blue);
  border: 1px solid #b8cce8;
  background: var(--blue-soft);
}

.hidden {
  display: none !important;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.auth-layout {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
  padding: 34px 0;
}

.auth-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 32px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.auth-copy p:not(.eyebrow) {
  max-width: 560px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.trust-strip span,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 13px;
  font-weight: 700;
}

.status-chip.pending,
.status-chip.requested,
.status-chip.draft,
.status-chip.paused {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-chip.rejected,
.status-chip.failed,
.status-chip.suspended,
.status-chip.closed {
  color: var(--coral);
  background: var(--coral-soft);
}

.status-chip.published,
.status-chip.approved,
.status-chip.active,
.status-chip.paid,
.status-chip.posted {
  color: var(--green);
  background: var(--green-soft);
}

.auth-panel,
.form-card,
.task-card,
.metrics-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 18px;
}

.segmented,
.tabs {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f4;
}

.segmented {
  margin-bottom: 16px;
}

.segmented button,
.tabs button {
  flex: 1;
  border-color: transparent;
  background: transparent;
}

.segmented button.active,
.tabs button.active {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 6px 15px rgba(31, 35, 40, 0.06);
}

.form-stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #3d4349;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd3d9;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

.workspace {
  padding: 28px 0 52px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.wallet-pill {
  display: grid;
  gap: 2px;
  min-width: 180px;
  padding: 14px 16px;
  border: 1px solid #b8decf;
  border-radius: 8px;
  background: var(--green-soft);
}

.wallet-pill span,
.metrics-grid span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.wallet-pill strong {
  font-size: 22px;
  color: var(--green);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metrics-grid article {
  padding: 16px;
  box-shadow: none;
}

.metrics-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.tabs {
  margin-bottom: 18px;
}

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

.task-card {
  overflow: hidden;
  box-shadow: none;
}

.task-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #d9e1e5;
}

.task-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.task-title-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.task-title-row h3 {
  margin: 0 0 3px;
  font-size: 18px;
}

.reward {
  flex: 0 0 auto;
  color: var(--amber);
}

.description,
.proof {
  margin: 0;
  color: #4a5157;
  line-height: 1.45;
}

.proof {
  padding: 10px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #78500f;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #3b4146;
  background: #f1f4f6;
  font-size: 13px;
}

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

.wallet-layout,
.admin-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
}

.table-stack,
.side-stack {
  display: grid;
  align-content: start;
  gap: 16px;
}

.form-card {
  align-content: start;
  padding: 16px;
  box-shadow: none;
}

.stack-list,
.review-list {
  display: grid;
  gap: 12px;
}

.list-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.item-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.product-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.product-row img {
  width: 96px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #d9e1e5;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100% - 36px));
  padding: 13px 15px;
  border-radius: 8px;
  color: #fff;
  background: #262b2f;
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--coral);
}

@media (max-width: 900px) {
  .auth-layout,
  .wallet-layout,
  .admin-grid,
  .task-grid {
    grid-template-columns: 1fr;
  }

  .auth-layout {
    align-items: start;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .wallet-pill {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  main {
    width: min(100% - 20px, 1180px);
  }

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

  .nav-actions {
    width: 100%;
  }

  .nav-actions button {
    flex: 1;
  }

  h1 {
    font-size: 38px;
  }

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

  .product-row {
    grid-template-columns: 1fr;
  }

  .product-row img {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .tabs {
    overflow-x: auto;
  }

  .tabs button {
    min-width: 120px;
  }
}
