:root {
  --affilun-admin-purple: #7c6cff;
  --affilun-admin-blue: #5ca9ff;
  --affilun-admin-mint: #4dd4c1;
  --affilun-admin-pink: #ff8ec7;
  --affilun-admin-ink: #2a2d3e;
  --affilun-admin-soft: #f5f6fa;
  --affilun-admin-white: #ffffff;
  --affilun-admin-shadow: 0 18px 48px rgba(42, 45, 62, 0.12);
  --affilun-admin-font-rounded: "Hiragino Maru Gothic ProN", "Zen Maru Gothic",
    "Hiragino Sans", "Yu Gothic", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
}

body.wp-admin .affilun-admin-page,
body.wp-admin[class*="_page_affilun-"],
body.wp-admin.toplevel_page_affilun-products {
  color: var(--affilun-admin-ink);
  font-family: var(--affilun-admin-font-rounded);
}

.affilun-admin-page a {
  color: var(--affilun-admin-purple);
}

.affilun-admin-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin: 20px 20px 22px 0;
  padding: 28px 32px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: radial-gradient(
      circle at 8% 18%,
      rgba(255, 142, 199, 0.22),
      transparent 28rem
    ),
    radial-gradient(
      circle at 92% 12%,
      rgba(92, 169, 255, 0.18),
      transparent 30rem
    ),
    linear-gradient(135deg, #fff 0%, var(--affilun-admin-soft) 100%);
  box-shadow: var(--affilun-admin-shadow);
}

.affilun-admin-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(124, 108, 255, 0.18),
    rgba(255, 142, 199, 0.2)
  );
}

.affilun-admin-hero__content,
.affilun-admin-hero__aside {
  position: relative;
  z-index: 1;
}

.affilun-admin-hero--compact {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 22px 28px;
}

.affilun-admin-hero--compact .affilun-admin-title {
  font-size: clamp(24px, 3vw, 34px);
}

.affilun-admin-logo {
  display: block;
  width: min(260px, 48vw);
  height: auto;
  margin-bottom: 14px;
}

.affilun-admin-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(124, 108, 255, 0.1);
  color: var(--affilun-admin-purple);
  font-size: 13px;
  font-weight: 800;
}

.affilun-admin-title {
  margin: 0 0 8px;
  color: var(--affilun-admin-ink);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 900;
}

.affilun-admin-title span {
  background: linear-gradient(
    135deg,
    var(--affilun-admin-purple),
    var(--affilun-admin-pink)
  );
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

.affilun-admin-lead {
  max-width: 680px;
  margin: 0;
  color: rgba(42, 45, 62, 0.72);
  font-size: 15px;
  font-weight: 700;
}

.affilun-admin-palette {
  display: grid;
  grid-template-columns: repeat(5, 42px);
  gap: 10px;
  justify-content: end;
}

.affilun-admin-palette span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: 0 10px 28px rgba(42, 45, 62, 0.14);
}

.affilun-admin-palette span:nth-child(1) {
  background: var(--affilun-admin-purple);
}
.affilun-admin-palette span:nth-child(2) {
  background: var(--affilun-admin-blue);
}
.affilun-admin-palette span:nth-child(3) {
  background: var(--affilun-admin-mint);
}
.affilun-admin-palette span:nth-child(4) {
  background: var(--affilun-admin-pink);
}
.affilun-admin-palette span:nth-child(5) {
  background: var(--affilun-admin-ink);
}

.affilun-cloud-free-trial-notice {
  display: inline-block;
  margin-top: 8px;
  color: var(--affilun-admin-purple);
  font-weight: 900;
}

.affilun-admin-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}

.affilun-admin-tool-card,
.affilun-admin-empty-state {
  display: block;
  padding: 18px;
  border: 1px solid #eef0f6;
  border-radius: 18px;
  background: var(--affilun-admin-soft);
  text-decoration: none;
}

.affilun-admin-tool-card strong {
  display: block;
  color: var(--affilun-admin-ink);
  font-weight: 900;
}

.affilun-admin-tool-card span {
  display: block;
  margin-top: 4px;
  color: rgba(42, 45, 62, 0.66);
  font-weight: 650;
}

.affilun-products-list-card,
.affilun-bulk-products,
.affilun-product-csv,
.affilun-add-new-product-panel,
.affilun-product-edit-card {
  margin: 18px 20px 18px 0 !important;
  padding: 20px !important;
  border: 1px solid #eef0f6 !important;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 14px 44px rgba(42, 45, 62, 0.08);
}

.affilun-products-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}

.affilun-products-list-row--views-search,
.affilun-products-list-row--actions-filter,
.affilun-products-list-row--bulk-bottom,
.affilun-products-list-row--pagination {
  justify-content: space-between;
}

.affilun-products-page .subsubsub.affilun-product-status-views {
  float: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  color: rgba(42, 45, 62, 0.56);
}

.affilun-products-page .subsubsub.affilun-product-status-views li {
  margin: 0;
}

.affilun-products-search-form {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.affilun-products-filter-form {
  margin: 0;
}

.affilun-products-filter-form .affilun-products-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.affilun-bulk-action-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.affilun-products-item-count {
  margin-left: auto;
  color: rgba(42, 45, 62, 0.7);
  font-weight: 700;
}

.affilun-click-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}

.affilun-click-summary-card {
  padding: 16px;
  border: 1px solid #eef0f6;
  border-radius: 18px;
  background: var(--affilun-admin-soft);
}

.affilun-click-summary-card strong {
  display: block;
  color: var(--affilun-admin-ink);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
}

.affilun-click-summary-card span {
  display: block;
  margin-top: 6px;
  color: rgba(42, 45, 62, 0.68);
  font-weight: 750;
}

.affilun-clicks-page .affilun-products-list-card h2 {
  margin-top: 0;
  color: var(--affilun-admin-ink);
  font-weight: 900;
}

.affilun-click-dimension + .affilun-click-dimension {
  margin-top: 24px;
}

.affilun-click-dimension h2 {
  margin: 0 0 10px;
}

.affilun-click-dimension .wp-list-table {
  margin: 0;
}

.affilun-click-entity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.affilun-click-entity__thumb {
  flex: 0 0 auto;
  display: inline-flex;
}

.affilun-click-entity__thumb img {
  width: 48px;
  height: 48px;
  border: 1px solid #e5e5e5;
  background: #fff;
  object-fit: contain;
}

.affilun-click-entity__body {
  display: grid;
  gap: 2px;
}

.affilun-click-entity__meta {
  color: rgba(42, 45, 62, 0.62);
  font-size: 12px;
  font-weight: 750;
}

.affilun-products-table {
  margin: 0 0 12px;
  border-color: #eef0f6 !important;
}

.affilun-products-table .column-cb,
.affilun-products-table .check-column {
  width: 2.2em;
}

.affilun-link-health-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.affilun-link-health-status--ok {
  color: #116149;
  background: rgba(77, 212, 193, 0.18);
}

.affilun-link-health-status--warning {
  color: #8a5a00;
  background: rgba(246, 163, 6, 0.18);
}

.affilun-link-health-status--broken {
  color: #9b1c31;
  background: rgba(255, 142, 199, 0.22);
}

.affilun-link-health-status--unknown {
  color: rgba(42, 45, 62, 0.72);
  background: var(--affilun-admin-soft);
}

.affilun-products-list-row--pagination {
  margin-bottom: 0;
}

.affilun-products-list-row--pagination .tablenav {
  margin: 0;
  width: 100%;
}

.affilun-products-list-row--pagination .tablenav-pages {
  float: none;
  text-align: right;
}

.affilun-bulk-products h2,
.affilun-product-csv h2 {
  margin: 0 0 12px !important;
  color: var(--affilun-admin-ink);
  font-weight: 900;
}

.affilun-bulk-products fieldset,
.affilun-product-csv fieldset {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid #eef0f6;
  border-radius: 18px;
  background: var(--affilun-admin-soft);
}

.affilun-bulk-products legend,
.affilun-product-csv legend {
  padding: 0 6px;
  color: var(--affilun-admin-purple);
  font-weight: 900;
}

.affilun-bulk-products select,
.affilun-bulk-products input[type="text"],
.affilun-product-csv textarea {
  border-color: #dde2ef;
  border-radius: 10px;
}

.affilun-product-edit-card p {
  margin: 0 0 16px;
}

.affilun-product-edit-field {
  display: grid;
  grid-template-columns: minmax(130px, 12rem) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0 0 16px;
}

.affilun-product-edit-field label,
.affilun-product-edit-card label {
  display: block;
  margin: 0;
  color: var(--affilun-admin-ink);
  font-weight: 700;
}

.affilun-product-edit-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.affilun-product-edit-control input.large-text {
  flex: 1 1 auto;
  min-width: 0;
}

.affilun-product-edit-open-link {
  flex: 0 0 auto;
  white-space: nowrap;
}

.affilun-product-edit-card input[type="text"],
.affilun-product-edit-card input[type="url"],
.affilun-product-edit-card select {
  border-color: #dde2ef;
  border-radius: 12px;
  min-height: 38px;
  background: #fff;
}

.affilun-product-edit-card .large-text {
  width: 100%;
  max-width: 100%;
}

.affilun-product-edit-provider-urls label,
.affilun-product-edit-provider-urls input,
.affilun-product-edit-provider-urls .description {
  font-weight: 400;
}

.affilun-product-edit-provider-urls h3 {
  font-weight: 600;
}

.affilun-product-edit-provider-urls input.large-text {
  width: 100%;
  max-width: 100%;
  font-weight: 400;
}

@media (max-width: 782px) {
  .affilun-product-edit-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .affilun-product-edit-control {
    align-items: stretch;
    flex-direction: column;
  }

  .affilun-product-edit-open-link {
    align-self: flex-start;
  }
}

.affilun-product-csv textarea {
  background: #fff;
}

.affilun-settings-tabs {
  margin-right: 20px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 44px rgba(42, 45, 62, 0.08);
}

.affilun-settings-tab-nav.nav-tab-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.affilun-settings-tab-nav .nav-tab {
  margin: 0;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--affilun-admin-soft);
  color: rgba(42, 45, 62, 0.72);
  font-weight: 800;
}

.affilun-settings-tab-nav .nav-tab.nav-tab-active,
.affilun-settings-tab-nav .nav-tab:hover,
.affilun-settings-tab-nav .nav-tab:focus {
  background: linear-gradient(
    135deg,
    var(--affilun-admin-purple),
    var(--affilun-admin-pink)
  );
  color: #fff;
  box-shadow: 0 12px 28px rgba(124, 108, 255, 0.24);
}

.affilun-settings-tab-panel {
  padding: 22px;
  border: 1px solid #eef0f6;
  border-radius: 22px;
  background: #fff;
}

.affilun-settings-tab-panel:not(.affilun-settings-tab-panel-active),
.affilun-settings-tab-panel[hidden] {
  display: none;
}

.affilun-settings-tab-panel h2 {
  margin-top: 0;
  color: var(--affilun-admin-ink);
  font-weight: 900;
}

.affilun-settings-guide-link {
  margin: 0 0 12px;
  font-weight: 800;
}

.affilun-settings-guide-link a::after {
  content: " ↗";
}

.affilun-provider-button-color-row input[type="color"] {
  width: 64px;
  height: 38px;
  padding: 3px;
  vertical-align: middle;
}

.affilun-rendering-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

.affilun-rendering-settings-controls .form-table {
  margin-top: 0;
}

.affilun-rendering-preview {
  position: sticky;
  top: 32px;
  padding: 18px;
  border: 1px solid #eef0f6;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fe 100%);
  box-shadow: 0 14px 44px rgba(42, 45, 62, 0.08);
}

.affilun-rendering-preview__header h3 {
  margin: 0 0 4px;
  color: var(--affilun-admin-ink);
  font-size: 16px;
  font-weight: 900;
}

.affilun-rendering-preview__header p {
  margin: 0 0 12px;
  color: rgba(42, 45, 62, 0.66);
  font-size: 12px;
  font-weight: 650;
}

.affilun-rendering-preview__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.affilun-rendering-preview__meta div {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(124, 108, 255, 0.08);
}

.affilun-rendering-preview__meta dt {
  margin: 0 0 2px;
  color: rgba(42, 45, 62, 0.58);
  font-size: 11px;
  font-weight: 800;
}

.affilun-rendering-preview__meta dd {
  margin: 0;
  overflow: hidden;
  color: var(--affilun-admin-ink);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.affilun-rendering-preview .affilun-card {
  margin: 0;
  max-width: 100%;
}

.affilun-amazon-discount-config fieldset {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 8px 16px;
	margin: 16px 0;
	padding: 12px;
	border: 1px solid #dcdcde;
	border-radius: 6px;
}

.affilun-amazon-discount-config legend {
	padding: 0 6px;
	font-weight: 600;
}

.affilun-amazon-discount-config__category {
	display: block;
}

.affilun-amazon-discount-preview {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid #dcdcde;
}

.affilun-rendering-preview .affilun-card__title span {
  color: inherit;
}

.affilun-settings-preview-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: calc(var(--affilun-card-radius) - 2px);
  background: linear-gradient(
    135deg,
    rgba(124, 108, 255, 0.16),
    rgba(255, 142, 199, 0.18)
  );
  color: var(--affilun-admin-purple);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.affilun-rendering-preview[data-affilun-preview-template="single-compact-card"]
  .affilun-card__provider,
.affilun-rendering-preview[data-affilun-preview-template="single-compact-card"]
  .affilun-card__description,
.affilun-rendering-preview[data-affilun-preview-template="single-compact-card"]
  .affilun-card__disclaimers {
  display: none;
}

.affilun-rendering-preview[data-affilun-preview-template="single-minimal-cta"]
  .affilun-card {
  display: block;
}

.affilun-rendering-preview[data-affilun-preview-template="single-minimal-cta"]
  .affilun-card__image,
.affilun-rendering-preview[data-affilun-preview-template="single-minimal-cta"]
  .affilun-card__provider,
.affilun-rendering-preview[data-affilun-preview-template="single-minimal-cta"]
  .affilun-card__brand,
.affilun-rendering-preview[data-affilun-preview-template="single-minimal-cta"]
  .affilun-card__description,
.affilun-rendering-preview[data-affilun-preview-template="single-minimal-cta"]
  .affilun-card__price-observed-at,
.affilun-rendering-preview[data-affilun-preview-template="single-minimal-cta"]
  .affilun-card__availability,
.affilun-rendering-preview[data-affilun-preview-template="single-minimal-cta"]
  .affilun-card__disclaimers {
  display: none;
}

.affilun-settings-tab-panel .form-table th {
  color: var(--affilun-admin-ink);
  font-weight: 800;
}

.affilun-settings-tab-panel input[type="text"],
.affilun-settings-tab-panel input[type="number"],
.affilun-settings-tab-panel input[type="url"],
.affilun-settings-tab-panel select,
.affilun-settings-tab-panel textarea {
  border-color: #dde2ef;
  border-radius: 10px;
}

.affilun-settings-tab-panel input:focus,
.affilun-settings-tab-panel select:focus,
.affilun-settings-tab-panel textarea:focus {
  border-color: var(--affilun-admin-purple);
  box-shadow: 0 0 0 1px var(--affilun-admin-purple);
}

.affilun-operation-section {
  display: flow-root;
  clear: both;
  margin: 0 0 22px;
}

.affilun-operation-section > h2 {
  margin-top: 0;
}

.affilun-operation-section .search-box {
  float: none !important;
  clear: both;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100% !important;
  margin: 12px 0;
}

.affilun-operation-section .search-box input,
.affilun-operation-section .search-box select {
  margin: 0;
}

.affilun-operation-section .wp-list-table {
  margin-top: 10px;
}

.affilun-operation-separator {
  clear: both;
  margin: 24px 0;
}

.affilun-operation-separator:last-child {
  display: none;
}

.affilun-rendering-preview__no-providers {
  margin: 0;
  color: rgba(42, 45, 62, 0.66);
  font-size: 12px;
  font-weight: 700;
}

.affilun-admin-page .button,
body.wp-admin[class*="_page_affilun-"] .button,
body.wp-admin.toplevel_page_affilun-products .button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    var(--affilun-admin-purple),
    var(--affilun-admin-pink)
  );
  color: #fff;
  box-shadow: 0 12px 28px rgba(124, 108, 255, 0.24);
  font-weight: 800;
}

.affilun-admin-page .button:hover,
.affilun-admin-page .button:focus,
body.wp-admin[class*="_page_affilun-"] .button:hover,
body.wp-admin[class*="_page_affilun-"] .button:focus,
body.wp-admin.toplevel_page_affilun-products .button:hover,
body.wp-admin.toplevel_page_affilun-products .button:focus,
.affilun-admin-page .button.button-primary:hover,
.affilun-admin-page .button.button-primary:focus,
body.wp-admin[class*="_page_affilun-"] .button.button-primary:hover,
body.wp-admin[class*="_page_affilun-"] .button.button-primary:focus,
body.wp-admin.toplevel_page_affilun-products .button.button-primary:hover,
body.wp-admin.toplevel_page_affilun-products .button.button-primary:focus {
  color: #fff;
  filter: brightness(0.98);
}

.affilun-admin-page .button:disabled,
.affilun-admin-page .button.disabled,
body.wp-admin[class*="_page_affilun-"] .button:disabled,
body.wp-admin[class*="_page_affilun-"] .button.disabled,
body.wp-admin.toplevel_page_affilun-products .button:disabled,
body.wp-admin.toplevel_page_affilun-products .button.disabled {
  background: #f5f6fa;
  color: rgba(42, 45, 62, 0.42) !important;
  box-shadow: none;
  cursor: not-allowed;
}

.affilun-admin-page .button-link-delete,
body.wp-admin[class*="_page_affilun-"] .button-link-delete,
body.wp-admin.toplevel_page_affilun-products .button-link-delete {
  border-color: #fecaca;
  color: #b91c1c;
}

.affilun-admin-page .submit {
  margin-right: 20px;
}

@media (max-width: 960px) {
  .affilun-admin-hero,
  .affilun-rendering-settings-layout {
    grid-template-columns: 1fr;
  }
  .affilun-admin-palette {
    justify-content: start;
  }
  .affilun-rendering-preview {
    position: static;
  }
}
