:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-strong: #f0f8f7;
  --ink: #17202a;
  --muted: #64717f;
  --line: #dfe5ea;
  --teal: #0d8a7f;
  --teal-dark: #075f58;
  --coral: #d95e42;
  --gold: #c8982d;
  --green: #2f8f5b;
  --red: #b84a4a;
  --shadow: 0 14px 40px rgba(23, 32, 42, 0.08);
  --radius: 8px;
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 24px;
  background: #142327;
  color: #f8faf9;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: #e8f6f3;
  color: #102429;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 4px;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0.68;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.16rem;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  line-height: 1;
}

h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.creator-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.rail-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #d9e3e1;
  text-align: left;
}

.nav-item.is-active,
.nav-item:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  font-weight: 800;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  color: #dbe8e6;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #48d597;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar,
.panel-heading,
.button-row,
.card-meta,
.detail-actions,
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.topbar {
  margin-bottom: 22px;
}

.topbar .eyebrow,
.panel .eyebrow,
.detail-panel .eyebrow {
  color: var(--teal-dark);
}

.topbar-actions,
.button-row,
.detail-actions {
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 760;
}

.primary-button {
  background: var(--teal);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.ghost-button,
.icon-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.ghost-button:hover,
.icon-button:hover {
  border-color: #b5c4ca;
}

.danger-button {
  border-color: #f1c2bd;
  background: #fff1ef;
  color: var(--red);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metric {
  min-height: 84px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.metric strong {
  font-size: 1.42rem;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.left-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.panel,
.detail-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.detail-panel {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f4f7f8;
}

.segmented-control button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 0.88rem;
  font-weight: 760;
}

.segmented-control .is-selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 6px rgba(23, 32, 42, 0.1);
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 12px;
  width: 100%;
  min-width: 0;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pipeline-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 210px;
}

.column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 840;
  text-transform: uppercase;
}

.campaign-card {
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: #ffffff;
  text-align: left;
  box-shadow: none;
}

.campaign-card.is-selected {
  border-color: #7ecac3;
  border-left-color: var(--coral);
  box-shadow: 0 12px 28px rgba(13, 138, 127, 0.14);
}

.campaign-card strong {
  font-size: 1rem;
}

.campaign-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.tag-row,
.file-list,
.update-list,
.task-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: #eef4f4;
  color: #304349;
  padding: 0 9px;
  font-size: 0.75rem;
  font-weight: 780;
}

.pill.warning {
  background: #fff4d8;
  color: #7a5604;
}

.pill.success {
  background: #e8f7ee;
  color: #1f6c43;
}

.pill.danger {
  background: #ffe9e5;
  color: #954438;
}

.progress-track {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: #e9eef2;
}

.progress-bar {
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--coral));
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: 14px;
  margin-top: 16px;
}

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

.field-stack span,
.form-grid label span,
.inline-field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 780;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  padding: 10px 11px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(13, 138, 127, 0.14);
}

.import-preview {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 14px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  color: var(--ink);
}

.preview-list,
.payment-list {
  display: grid;
  gap: 10px;
}

.preview-item,
.payment-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(23, 32, 42, 0.08);
}

.preview-item span,
.payment-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
}

.payment-row {
  grid-template-columns: minmax(0, 1fr) 100px 130px;
  align-items: center;
  padding: 12px 0;
}

.payment-row strong {
  display: block;
}

.payment-row small,
.preview-item strong {
  color: var(--muted);
}

.detail {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  min-height: 160px;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(20, 35, 39, 0.88), rgba(20, 35, 39, 0.38)),
    url("/assets/creator-workspace.png") center / cover;
  color: #ffffff;
  padding: 18px;
}

.detail-hero h3 {
  max-width: 260px;
  margin-top: 54px;
  font-size: 1.55rem;
}

.detail-hero p {
  max-width: 300px;
  color: rgba(255, 255, 255, 0.82);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-grid label {
  display: grid;
  gap: 7px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.task-item input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--teal);
}

.task-item span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.section-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 860;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid #f1c2bd;
  border-radius: var(--radius);
  background: #fff8f7;
}

.inline-field {
  display: grid;
  gap: 7px;
}

.reply-box {
  display: grid;
  gap: 10px;
}

.reply-output {
  min-height: 138px;
}

.update-list {
  display: grid;
}

.update-item,
.file-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.update-item p,
.file-item p {
  margin-bottom: 4px;
}

.file-item a {
  color: var(--teal-dark);
  font-weight: 780;
  text-decoration: none;
}

.file-item a:hover {
  text-decoration: underline;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: 1fr 220px;
  }

  .rail-nav,
  .profile-chip {
    display: none;
  }

  .creator-photo {
    aspect-ratio: 16 / 9;
  }

  .split-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .workspace,
  .rail {
    padding: 16px;
  }

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

  .metric-strip,
  .import-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .rail {
    grid-template-columns: 1fr;
  }

  .creator-photo {
    display: none;
  }

  .pipeline-board {
    display: flex;
    max-width: 100%;
  }

  .pipeline-column {
    flex: 0 0 78vw;
  }
}
