:root {
  --ink: #171717;
  --muted: #696f79;
  --line: #e4e2dc;
  --paper: #fffdf8;
  --surface: #ffffff;
  --soft: #f4f1ea;
  --soft-strong: #ebe5d9;
  --accent: #b8202f;
  --gold: #b58a44;
  --teal: #147b72;
  --blue: #315f9a;
  --green: #387d3d;
  --shadow: 0 18px 45px rgba(23, 23, 23, 0.08);
  --panel-shadow: 0 14px 38px rgba(23, 23, 23, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 1) 0%, rgba(246, 242, 234, 1) 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 34px;
  padding: 36px;
  background:
    linear-gradient(90deg, rgba(255, 253, 248, 0.97), rgba(255, 253, 248, 0.82)),
    url("./assets/faber-og.jpg") center / cover;
}

.login-header {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand-logo {
  width: clamp(150px, 18vw, 220px);
  height: auto;
}

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

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

h1 {
  max-width: 720px;
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.96;
  letter-spacing: 0;
}

.login-grid {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.role-card {
  min-height: 330px;
  position: relative;
  overflow: hidden;
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(23, 23, 23, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.role-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
}

.role-card:nth-child(2)::before {
  background: var(--teal);
}

.role-card:nth-child(3)::before {
  background: var(--gold);
}

.role-card:hover,
.role-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 24px 60px rgba(23, 23, 23, 0.13);
  outline: none;
}

.role-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
}

.role-card:nth-child(2) .role-icon {
  background: var(--teal);
}

.role-card:nth-child(3) .role-icon {
  background: var(--gold);
}

.role-title {
  margin-top: 22px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
}

.role-copy {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.role-meta {
  margin-top: auto;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.influencer-select-label {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.influencer-login select {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-footer {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #4c5158;
  font-size: 13px;
}

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

.sidebar {
  min-height: 100vh;
  padding: 22px;
  background: linear-gradient(180deg, #111111 0%, #191817 100%);
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand,
.topbar,
.top-actions,
.metric-card,
.list-row,
.campaign-card,
.creator-row,
.finance-row,
.asset-row {
  display: flex;
  align-items: center;
}

.sidebar-brand {
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-brand img {
  width: 148px;
  height: auto;
  filter: brightness(0) invert(1);
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

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

.user-block {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 22px 0;
}

.avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-weight: 800;
}

.user-block p {
  margin: 0;
  font-weight: 800;
}

.user-block span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
}

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

.nav button {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  position: relative;
  padding: 0 12px 0 14px;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.nav button.active,
.nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.nav button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: var(--gold);
  border-radius: 999px;
}

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

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.page-subtitle {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.top-actions {
  gap: 10px;
}

.primary-button,
.secondary-button,
.tour-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
}

.secondary-button {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.tour-button {
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  white-space: nowrap;
}

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

.date-chip {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.content {
  display: grid;
  gap: 16px;
}

.hero-strip {
  min-height: 230px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 16px;
}

.hero-copy {
  padding: 26px;
  color: #fff;
  background: linear-gradient(135deg, #171717 0%, #25211c 100%);
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
}

.hero-copy h3 {
  max-width: 620px;
  margin-bottom: 12px;
  font-size: clamp(26px, 3.8vw, 42px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 620px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
}

.hero-image {
  min-height: 230px;
  background: url("./assets/editorial-cover.jpg") center / cover;
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
}

.metrics-grid,
.two-column,
.three-column,
.campaign-grid,
.creator-grid {
  display: grid;
  gap: 14px;
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-column {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.three-column {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.panel,
.metric-card,
.campaign-card,
.creator-row,
.finance-row,
.asset-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
}

.panel {
  padding: 20px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.panel-title h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.panel-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-card {
  min-height: 124px;
  position: relative;
  overflow: hidden;
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
}

.metric-card:nth-child(2)::before {
  background: var(--teal);
}

.metric-card:nth-child(3)::before {
  background: var(--gold);
}

.metric-card:nth-child(4)::before {
  background: var(--blue);
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  font-size: 32px;
  letter-spacing: 0;
}

.metric-card small {
  color: var(--green);
  font-weight: 700;
}

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

.list-row {
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row strong {
  display: block;
  margin-bottom: 4px;
}

.list-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.tag {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14);
}

.tag.gold {
  background: var(--gold);
}

.tag.teal {
  background: var(--teal);
}

.tag.blue {
  background: var(--blue);
}

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

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-row div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  background: var(--soft);
  border-radius: 999px;
}

.bar-track span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.campaign-card,
.creator-row,
.finance-row,
.asset-row {
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.campaign-card:hover,
.creator-row:hover,
.finance-row:hover,
.asset-row:hover,
.panel:hover,
.metric-card:hover {
  border-color: rgba(181, 138, 68, 0.5);
}

.insight-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
  color: #fff;
  background: linear-gradient(135deg, #171717 0%, #2b241b 100%);
  border: 1px solid rgba(181, 138, 68, 0.28);
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
}

.insight-strip .eyebrow {
  color: #d7b576;
}

.insight-strip h3 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.08;
}

.insight-strip p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.55;
}

.insight-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.insight-points span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.campaign-card {
  align-items: flex-start;
}

.campaign-card h3,
.creator-row h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.campaign-card p,
.creator-row p,
.finance-row p,
.asset-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.progress-ring {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--teal) var(--progress), var(--soft) 0);
  border-radius: 50%;
  font-weight: 800;
}

.progress-ring span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 50%;
}

.creator-row img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}

.creator-row > div:first-child {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.finance-row strong,
.asset-row strong {
  display: block;
  margin-bottom: 5px;
}

.empty-state {
  padding: 28px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: transparent;
  pointer-events: none;
}

.tour-panel {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 60;
  width: min(440px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(17, 17, 17, 0.22);
}

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

.tour-panel-header .eyebrow {
  display: block;
  margin-bottom: 5px;
}

.tour-panel-header h3 {
  max-width: 340px;
  margin: 0;
  overflow: visible;
  font-size: 20px;
  line-height: 1.15;
  text-overflow: initial;
  white-space: normal;
}

.tour-panel .icon-button {
  flex: 0 0 34px;
  min-height: 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--soft);
  border-color: var(--line);
}

.tour-panel .icon-button svg {
  width: 18px;
  height: 18px;
}

.tour-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tour-step-count {
  color: var(--accent);
}

.tour-body {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.tour-body p {
  margin-bottom: 12px;
}

.tour-body strong {
  color: var(--ink);
}

.tour-question-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.tour-question-list div {
  padding: 9px 10px;
  color: var(--ink);
  background: #fbfaf6;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.tour-voice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tour-voice .secondary-button {
  min-height: 34px;
  padding: 0 10px;
  background: #fff;
}

.tour-voice span:last-child {
  display: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tour-progress {
  height: 4px;
  overflow: hidden;
  margin: 8px 0;
  background: var(--soft);
  border-radius: 999px;
}

.tour-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: inherit;
  transition: width 180ms ease;
}

.tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.tour-actions > div {
  display: inline-flex;
  gap: 6px;
}

.tour-actions .primary-button,
.tour-actions .secondary-button {
  min-height: 32px;
  padding: 0 10px;
}

.tour-next-short {
  display: none;
}

body.tour-active {
  scroll-padding-bottom: 176px;
}

.tour-focus {
  position: relative;
  z-index: 50;
  outline: 3px solid rgba(184, 32, 47, 0.88);
  outline-offset: 5px;
  box-shadow: 0 20px 60px rgba(17, 17, 17, 0.22);
}

.nav button.tour-focus {
  outline-offset: 3px;
}

.login-grid.tour-focus {
  outline: 0;
  box-shadow: none;
}

@media (max-width: 980px) {
  .login-grid,
  .metrics-grid,
  .three-column,
  .campaign-grid,
  .creator-grid,
  .hero-strip,
  .two-column,
  .insight-strip {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    min-height: auto;
  }

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

  .insight-points {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .login-screen,
  .main,
  .sidebar {
    padding: 18px;
  }

  body.tour-active {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }

  .login-screen {
    align-content: start;
    gap: 22px;
    padding-bottom: calc(136px + env(safe-area-inset-bottom));
  }

  .brand-logo {
    width: 145px;
  }

  h1 {
    font-size: 34px;
    line-height: 0.96;
  }

  .login-header,
  .topbar,
  .login-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .role-card {
    min-height: 210px;
    padding: 22px;
  }

  .role-title {
    font-size: 28px;
  }

  .dashboard {
    padding-bottom: calc(118px + env(safe-area-inset-bottom));
  }

  .sidebar-brand,
  .user-block,
  .topbar {
    gap: 12px;
  }

  .sidebar-brand img {
    width: 148px;
  }

  .top-actions {
    align-items: stretch;
  }

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

  .nav button {
    min-height: 48px;
    padding: 10px;
  }

  .top-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .tour-button {
    flex: 1;
  }

  .date-chip {
    flex: 1;
    justify-content: center;
  }

  .insight-points {
    grid-template-columns: 1fr 1fr;
  }

  .tour-panel {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 8px;
  }

  .tour-actions,
  .tour-actions > div,
  .tour-voice {
    width: auto;
  }

  .tour-actions {
    align-items: center;
    flex-direction: row;
  }

  .tour-actions button {
    flex: 0 0 auto;
  }

  .tour-voice button {
    flex: 0 0 34px;
    width: 34px;
    padding: 0;
  }

  .tour-panel-header {
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
  }

  .tour-panel-header .eyebrow,
  .tour-panel-header h3,
  .tour-body {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .tour-panel .icon-button {
    min-height: 28px;
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .tour-voice {
    margin-top: 4px;
    padding: 0 34px 0 0;
    background: transparent;
    border: 0;
  }

  .tour-meta-row {
    margin: 0 34px 6px 0;
    min-height: 18px;
    font-size: 12px;
  }

  .tour-meta-row #tour-voice-status {
    max-width: 132px;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tour-step-count {
    white-space: nowrap;
  }

  .tour-voice .secondary-button span,
  .tour-next-label {
    display: none;
  }

  .tour-next-short {
    display: inline;
  }

  .tour-actions .secondary-button {
    min-height: 32px;
    padding: 0 9px;
    font-size: 12px;
  }

  .tour-actions .primary-button {
    min-width: 46px;
    padding: 0 12px;
  }

  .tour-focus {
    outline-width: 2px;
    outline-offset: 3px;
    box-shadow: none;
  }
}
