.hl-affdash {
  margin: 20px auto 40px;
  max-width: 1200px;
  color: #0f172a;
}

.hl-affdash__hero {
  background: linear-gradient(135deg, #f5f7ff 0%, #eaf3ff 100%);
  padding: 24px 28px;
  border-radius: 18px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.hl-affdash__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  margin: 0 0 6px;
  color: #64748b;
}

.hl-affdash__lede {
  margin: 4px 0 0;
  color: #475569;
}

.hl-affdash__summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hl-affdash__listing-select {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hl-affdash__listing-select select {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.hl-affdash__summary-card {
  background: #fff;
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.hl-affdash__summary-card strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
  color: #0f172a;
}

.hl-affdash__summary-card small {
  color: #64748b;
}

.hl-affdash__alert {
  margin: 16px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: #eef2ff;
  color: #312e81;
  display: inline-block;
}

.hl-affdash__alert:empty {
  display: none;
}

.hl-affdash__alert.is-error {
  background: #fef2f2;
  color: #b91c1c;
}

.hl-affdash__alert.is-success {
  background: #ecfdf3;
  color: #166534;
}

.hl-affdash__toast {
  position: fixed;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10000;
}

.hl-affdash__toast::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.14);
  flex-shrink: 0;
}

.hl-affdash__toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hl-affdash__toast.is-error {
  background: rgba(185, 28, 28, 0.92);
  box-shadow: 0 16px 38px rgba(185, 28, 28, 0.25);
}

.hl-affdash__toast.is-error::before {
  background: #ef4444;
  box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.14);
}

.hl-affdash__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.hl-affdash__card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.hl-affdash__card--table {
  margin-top: 18px;
}

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

.hl-affdash__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hl-affdash__hint {
  margin: 4px 0 0;
  color: #6b7280;
}

.hl-affdash__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.hl-affdash__form input,
.hl-affdash__form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
}

.hl-affdash__button {
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
}

.hl-affdash__button--primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-color: #1d4ed8;
}

.aff-share-btn {
  padding: 8px 10px;
  font-size: 13px;
}

.hl-affdash__refresh {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
}

.aff-user-picker {
  position: relative;
}

.aff-user-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.08);
  max-height: 200px;
  overflow: auto;
  z-index: 20;
}

.aff-user-result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.aff-user-result:hover {
  background: #f8fafc;
}

.aff-user-empty {
  padding: 10px 12px;
  color: #6b7280;
}

.table-responsive {
  overflow-x: auto;
}

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

#affiliate-table th,
#affiliate-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.aff-cell__title {
  font-weight: 600;
}

.aff-cell__sub {
  color: #6b7280;
  font-size: 13px;
}

.aff-state {
  background: #eef2ff;
  color: #312e81;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.hl-affdash__grid--routes {
  margin-top: 18px;
}

.hl-affdash__breakdown {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hl-affdash__pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  border-radius: 12px;
  min-width: 150px;
}

.hl-affdash__pill strong {
  display: block;
  color: #0f172a;
  margin-top: 4px;
}

.hl-affdash__routes {
  list-style: decimal;
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.aff-route {
  font-weight: 600;
  color: #0f172a;
}

.aff-route__meta {
  color: #6b7280;
  font-size: 13px;
}

.aff-route__product {
  color: #0f172a;
  font-weight: 600;
  margin-left: 6px;
}

.aff-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.aff-modal.is-open {
  display: flex;
}

.aff-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.aff-modal__panel {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  z-index: 1;
}

.aff-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.aff-modal__mode {
  display: flex;
  gap: 14px;
  margin: 6px 0;
}

.aff-section[hidden] {
  display: none !important;
}

.aff-modal__head h3 {
  margin: 0 0 4px;
}

@media (max-width: 768px) {
  .hl-affdash__hero {
    flex-direction: column;
  }
  .hl-affdash__summary {
    grid-template-columns: 1fr;
  }
}
