:root {
  --ink: #14213d;
  --muted: #667085;
  --faint: #8a97a8;
  --line: #dbe3ec;
  --line-strong: #c8d3df;
  --soft: #f5f7fa;
  --soft-green: #e9f4ef;
  --panel: #ffffff;
  --brand: #165f4c;
  --brand-dark: #12362f;
  --coral: #d95f48;
  --amber: #bd8424;
  --blue: #2f6fed;
  --red: #b23b2d;
  --shadow: 0 16px 42px rgba(20, 33, 61, 0.08);
  --shadow-soft: 0 10px 26px rgba(20, 33, 61, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, #eef4f2 0, #f7f9fb 360px),
    #f7f9fb;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0)),
    var(--brand-dark);
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
}

.brand-name,
.brand-meta,
.eyebrow,
.intro,
.sidebar-panel p,
.rank-item p,
.insight-card p {
  margin: 0;
}

.brand-name {
  font-weight: 800;
}

.brand-meta {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.nav-item.active,
.nav-item:hover {
  color: var(--brand-dark);
  background: #ffffff;
}

.sidebar-panel {
  position: absolute;
  right: 22px;
  bottom: 24px;
  left: 22px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.panel-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-panel p {
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.5;
}

.main {
  min-width: 0;
  padding: 30px;
}

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

.page-title {
  max-width: 760px;
}

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

h1,
h2 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.04;
}

h2 {
  font-size: 19px;
}

.intro {
  max-width: 620px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: min(460px, 100%);
}

.search-box,
select,
.text-button {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.search-box {
  display: flex;
  align-items: center;
  width: min(330px, 100%);
  gap: 9px;
  padding: 0 13px;
  box-shadow: var(--shadow-soft);
}

.search-box span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  color: var(--faint);
  background: var(--soft);
  font-size: 14px;
  font-weight: 800;
}

input {
  width: 100%;
  min-width: 150px;
  border: 0;
  outline: 0;
}

select {
  min-width: 148px;
  padding: 0 12px;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.text-button {
  padding: 0 13px;
  color: var(--brand);
  cursor: pointer;
  font-weight: 800;
}

.text-button:hover {
  border-color: var(--brand);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow-soft);
}

.summary-strip div {
  display: grid;
  gap: 4px;
  min-height: 70px;
  align-content: center;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.88);
}

.summary-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-strip strong {
  font-size: 15px;
}

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

.metric-card,
.panel,
.insight-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 132px;
  padding: 18px;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 36px;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.metric-card.accent {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
    var(--brand);
  border-color: var(--brand);
}

.metric-card.accent .metric-label,
.metric-card.accent small {
  color: rgba(255, 255, 255, 0.76);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(310px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--brand);
  background: var(--soft-green);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

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

.pipeline-column {
  min-height: 236px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
}

.pipeline-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.deal-card {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #ffffff;
}

.deal-card strong {
  font-size: 13px;
}

.deal-card span {
  color: var(--muted);
  font-size: 12px;
}

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

.insight-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  padding: 15px;
}

.insight-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.insight-icon.warm {
  background: var(--amber);
}

.insight-icon.red {
  background: var(--coral);
}

.insight-card strong {
  display: block;
  margin-bottom: 5px;
}

.insight-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.rank-index {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--coral);
  font-size: 13px;
  font-weight: 800;
}

.rank-item p {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-item small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-value {
  font-weight: 800;
}

.table-panel {
  margin-bottom: 18px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  font-size: 14px;
}

tr:hover td {
  background: #fbfcfd;
}

.creator-name,
.coupon-code {
  font-weight: 800;
}

.coupon-code {
  word-break: break-word;
}

.subtle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.status {
  display: inline-flex;
  min-width: 86px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.status.Completed {
  color: var(--brand);
  background: var(--soft-green);
}

.status.Active {
  color: #1c5fc7;
  background: #eaf1ff;
}

.status.Pending {
  color: #8b5e00;
  background: #fff2d6;
}

.status.Rejected {
  color: var(--red);
  background: #fdebe7;
}

.compact th,
.compact td {
  padding: 11px 8px;
}

.content-list {
  display: grid;
  gap: 10px;
  max-height: 438px;
  overflow: auto;
  padding-right: 4px;
}

.content-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.content-item strong {
  display: block;
}

.content-item a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: var(--blue);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  text-align: center;
}

.mobile-card-list,
.mobile-nav {
  display: none;
}

.creator-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.creator-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.creator-card-top strong,
.creator-card-top span {
  display: block;
}

.creator-card-top span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.creator-card-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft);
}

.creator-card-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.creator-card-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.creator-card-code {
  display: grid;
  gap: 3px;
  border-radius: 8px;
  padding: 10px;
  background: var(--soft-green);
}

.creator-card-code span {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.creator-card-code small {
  color: var(--muted);
}

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

  .sidebar {
    position: static;
    display: grid;
    height: auto;
    grid-template-columns: 1fr auto;
    gap: 18px;
  }

  .brand-lockup {
    margin-bottom: 0;
  }

  .nav-list {
    grid-column: 1 / -1;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .sidebar-panel {
    position: static;
    max-width: 360px;
  }

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

@media (max-width: 920px) {
  .topbar,
  .dashboard-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    justify-content: stretch;
    min-width: 0;
  }

  .search-box {
    flex: 1 1 260px;
  }

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

@media (max-width: 680px) {
  body {
    padding-bottom: 72px;
  }

  .main,
  .sidebar {
    padding: 18px;
  }

  .sidebar {
    display: block;
  }

  .brand-lockup {
    margin-bottom: 16px;
  }

  .nav-list,
  .sidebar-panel {
    display: none;
  }

  h1 {
    font-size: 31px;
  }

  .intro {
    font-size: 14px;
  }

  .topbar-actions,
  .panel-header {
    display: grid;
  }

  .search-box,
  select,
  .text-button {
    width: 100%;
  }

  .summary-strip,
  .metric-grid,
  .dashboard-grid,
  .pipeline-board,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: auto;
  }

  #creators .table-wrap {
    display: none;
  }

  .mobile-card-list {
    display: grid;
    gap: 12px;
  }

  .creator-card-top {
    align-items: flex-start;
  }

  .creator-card-stats {
    grid-template-columns: 1fr 1fr;
  }

  .creator-card-stats div:first-child {
    grid-column: 1 / -1;
  }

  .mobile-nav {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    border: 1px solid rgba(18, 54, 47, 0.18);
    border-radius: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 34px rgba(20, 33, 61, 0.18);
    backdrop-filter: blur(14px);
  }

  .mobile-nav a {
    display: grid;
    min-height: 42px;
    place-items: center;
    border-radius: 7px;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
  }

  .mobile-nav a:focus,
  .mobile-nav a:hover {
    background: var(--soft-green);
  }
}
