.admin-page {
  min-height: 100vh;
  padding: 32px;
  background:
    radial-gradient(circle at top left, rgba(38, 226, 255, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(20, 120, 160, 0.14), transparent 36%),
    #020b18;
  color: #f8fafc;
}

.admin-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
}

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

.admin-header h1 {
  margin: 12px 0;
  font-size: clamp(2rem, 4vw, 4rem);
}

.admin-muted {
  color: rgba(226, 232, 240, 0.72);
}

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

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

.admin-card h2 {
  font-size: 2.4rem;
  margin: 8px 0;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: #67e8f9;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-table td {
  color: rgba(248, 250, 252, 0.9);
  font-size: 0.92rem;
}

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

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

.admin-list-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(103, 232, 249, 0.16);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.52);
}

.admin-list-item strong {
  color: #f8fafc;
}

.admin-list-item span {
  color: rgba(226, 232, 240, 0.76);
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.78rem;
  border: 1px solid rgba(103, 232, 249, 0.22);
  color: #67e8f9;
  background: rgba(8, 47, 73, 0.35);
}

.admin-badge.is-danger {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.32);
}

.admin-badge.is-ok {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(20, 83, 45, 0.32);
}

@media (max-width: 900px) {
  .admin-page {
    padding: 18px;
  }

  .admin-header {
    flex-direction: column;
  }

  .admin-grid,
  .admin-kpis,
  .admin-list-grid {
    grid-template-columns: 1fr;
  }
}

/* === ADMIN EXTENDED STATS START === */
.admin-card p {
  margin: 8px 0;
}

.admin-card .admin-muted {
  font-size: 0.95rem;
}

.admin-list-item div {
  min-width: 0;
}

.admin-list-item strong,
.admin-list-item span {
  overflow-wrap: anywhere;
}

.admin-list-item .admin-badge {
  flex: 0 0 auto;
  align-self: flex-start;
}

@media (max-width: 1100px) {
  .admin-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* === ADMIN EXTENDED STATS END === */

/* === ADMIN FEEDBACK WORKFLOW START === */
.admin-feedback-item,
.admin-feedback-review-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.52);
}

.admin-feedback-item {
  grid-template-columns: 1fr auto;
  align-items: flex-start;
}

.admin-feedback-main p,
.admin-feedback-review-card p {
  margin: 8px 0 0;
  color: rgba(226, 232, 240, 0.78);
}

.admin-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
  justify-content: flex-end;
}

.admin-action-badge {
  cursor: pointer;
  font-family: inherit;
}

.admin-action-badge:hover {
  filter: brightness(1.15);
}

.admin-feedback-complete-form {
  display: grid;
  gap: 12px;
}

.admin-feedback-complete-form label {
  display: grid;
  gap: 8px;
  color: rgba(226, 232, 240, 0.86);
  font-weight: 700;
}

.admin-feedback-complete-form textarea {
  width: 100%;
  resize: vertical;
  border-radius: 16px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  background: rgba(2, 11, 24, 0.65);
  color: #f8fafc;
  padding: 14px 16px;
  font: inherit;
}

.admin-feedback-complete-form textarea:focus {
  outline: none;
  border-color: rgba(103, 232, 249, 0.7);
  box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.12);
}

@media (max-width: 800px) {
  .admin-feedback-item {
    grid-template-columns: 1fr;
  }

  .admin-feedback-actions {
    justify-content: flex-start;
  }
}
/* === ADMIN FEEDBACK WORKFLOW END === */

/* === ADMIN SOCIAL DRAFT START === */
.admin-social-panel {
  margin-bottom: 28px;
}

.admin-social-message {
  margin: 12px 0;
  color: rgba(226, 232, 240, 0.85);
  font-weight: 700;
}

.admin-social-message[data-type="ok"] {
  color: #67e8f9;
}

.admin-social-message[data-type="error"] {
  color: #fca5a5;
}

.admin-social-draft {
  display: grid;
  gap: 22px;
}

.admin-social-empty {
  padding: 18px;
  border: 1px dashed rgba(103, 232, 249, 0.26);
  border-radius: 18px;
}

.admin-social-draft:not(:has(.admin-social-empty)) {
  grid-template-columns: minmax(240px, 360px) 1fr;
  align-items: flex-start;
}

.admin-social-preview img {
  display: block;
  width: 100%;
  max-width: 360px;
  border-radius: 22px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.admin-social-content {
  display: grid;
  gap: 12px;
}

.admin-social-content h3 {
  margin: 0;
  color: #f8fafc;
}

.admin-social-content textarea {
  width: 100%;
  min-height: 230px;
  resize: vertical;
  border-radius: 18px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  background: rgba(2, 11, 24, 0.65);
  color: #f8fafc;
  padding: 14px 16px;
  font: inherit;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .admin-social-draft:not(:has(.admin-social-empty)) {
    grid-template-columns: 1fr;
  }
}
/* === ADMIN SOCIAL DRAFT END === */

/* === ADMIN SOCIAL DRAFT VISUAL V2 START === */
.admin-social-preview {
  display: flex;
  justify-content: center;
}

.admin-social-preview img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: rgba(2, 11, 24, 0.8);
}

.admin-social-draft:not(:has(.admin-social-empty)) {
  grid-template-columns: minmax(280px, 410px) 1fr;
}

.admin-social-preview img {
  max-width: 410px;
}

@media (max-width: 900px) {
  .admin-social-preview img {
    max-width: min(100%, 420px);
  }
}
/* === ADMIN SOCIAL DRAFT VISUAL V2 END === */

/* === ADMIN INSTAGRAM PUBLISH START === */
.admin-social-published {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(45, 212, 191, 0.32);
  border-radius: 14px;
  color: #67e8f9;
  background: rgba(45, 212, 191, 0.08);
  font-weight: 800;
}

.admin-social-error {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(248, 113, 113, 0.34);
  border-radius: 14px;
  color: #fecaca;
  background: rgba(248, 113, 113, 0.08);
  font-weight: 700;
}

.admin-feedback-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
/* === ADMIN INSTAGRAM PUBLISH END === */


.admin-social-variant {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0.35rem 0 0.85rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 999px;
  background: rgba(8, 20, 38, 0.06);
  color: #486176;
  font-size: 0.78rem;
  font-weight: 700;
}

/* === ADMIN REEL DIARIO START === */

.admin-reel-preview {
  display: flex;
  justify-content: center;
  align-items: center;
}

.admin-reel-preview video {
  display: block;
  width: min(320px, 100%);
  aspect-ratio: 9 / 16;
  max-height: 680px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #020617;
  object-fit: cover;
}

.admin-social-content textarea[data-admin-reel-caption] {
  min-height: 180px;
}

/* === ADMIN REEL DIARIO END === */

/* ===== Carrusel mensual afiliados ===== */

.admin-carousel-list {
  margin: 0.75rem 0 1.25rem;
  padding-left: 1.25rem;
}

.admin-carousel-list li {
  margin-bottom: 0.75rem;
  color: var(--text-color, #e8eef8);
}

.admin-carousel-list span {
  color: var(--muted-color, #9ca8b8);
}

.admin-carousel-list a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.admin-field-label {
  display: block;
  margin: 1rem 0 0.4rem;
  font-weight: 700;
}

.admin-carousel-product-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.admin-carousel-product-thumb {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.35);
}

.admin-carousel-product-item em {
  color: var(--muted-color, #9ca8b8);
  font-style: normal;
  font-size: 0.9rem;
}

.admin-carousel-product-item:first-child .admin-carousel-product-thumb,
.admin-carousel-product-item:last-child .admin-carousel-product-thumb {
  width: 96px;
  height: 120px;
  flex-basis: 96px;
}

/* ===== Preview tipo carrusel Instagram ===== */

.admin-carousel-preview {
  max-width: 420px;
  margin: 1rem auto 1.6rem;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.55);
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.35);
  overflow: hidden;
}

.admin-carousel-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: var(--muted-color, #9ca8b8);
}

.admin-carousel-preview-header strong {
  color: var(--text-color, #e8eef8);
}

.admin-carousel-frame {
  position: relative;
  background: #020617;
}

.admin-carousel-media {
  aspect-ratio: 4 / 5;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.admin-carousel-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-carousel-image-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
  color: #e2e8f0;
  background:
    radial-gradient(circle at top, rgba(34, 211, 238, 0.24), transparent 45%),
    linear-gradient(135deg, #020617, #0f766e);
  font-weight: 800;
  font-size: 1.45rem;
}

.admin-carousel-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
}

.admin-carousel-nav:hover {
  background: rgba(15, 23, 42, 0.92);
}

.admin-carousel-nav-prev {
  left: 0.75rem;
}

.admin-carousel-nav-next {
  right: 0.75rem;
}

.admin-carousel-preview-body {
  padding: 0.95rem 1rem 0.65rem;
}

.admin-carousel-preview-body p {
  margin: 0;
  color: var(--muted-color, #9ca8b8);
  line-height: 1.5;
}

.admin-carousel-preview-body .admin-carousel-category {
  margin-top: 0.4rem;
  color: #67e8f9;
  font-size: 0.9rem;
  font-weight: 700;
}

.admin-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  padding: 0 1rem 1rem;
}

.admin-carousel-dot {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.55);
  cursor: pointer;
}

.admin-carousel-dot.is-active {
  width: 22px;
  background: #67e8f9;
}

@media (max-width: 640px) {
  .admin-carousel-preview {
    max-width: 100%;
  }

  .admin-carousel-nav {
    width: 38px;
    height: 38px;
  }
}

/* ===== Layout carrusel afiliados: preview + productos ===== */

.admin-affiliate-carousel-content {
  margin-top: 0.75rem;
}

.admin-carousel-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(320px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.admin-carousel-layout-preview,
.admin-carousel-layout-side {
  min-width: 0;
}

.admin-carousel-layout .admin-carousel-preview {
  margin: 0;
  max-width: 420px;
}

.admin-carousel-side-header {
  margin-bottom: 0.9rem;
}

.admin-carousel-side-header h3 {
  margin: 0;
}

.admin-carousel-side-header p {
  margin: 0.25rem 0 0;
  color: var(--muted-color, #9ca8b8);
  font-weight: 700;
}

.admin-carousel-selected-list {
  max-height: 440px;
  overflow: auto;
  padding-right: 0.5rem;
}

.admin-carousel-actions {
  margin-top: 1rem;
}

.admin-carousel-actions .primary-button,
.admin-carousel-actions .secondary-button {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .admin-carousel-layout {
    grid-template-columns: 1fr;
  }

  .admin-carousel-layout .admin-carousel-preview {
    margin: 0 auto;
  }
}

/* ===== Carrusel afiliados: 3 columnas ===== */

.admin-carousel-layout-three {
  grid-template-columns: minmax(280px, 420px) minmax(280px, 0.9fr) minmax(320px, 0.9fr);
}

.admin-carousel-layout-products,
.admin-carousel-layout-caption {
  min-width: 0;
}

.admin-carousel-layout-caption textarea[data-admin-affiliate-carousel-caption] {
  width: 100%;
  min-height: 260px;
}

.admin-carousel-layout-caption .admin-carousel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-carousel-layout-caption .admin-carousel-actions .primary-button,
.admin-carousel-layout-caption .admin-carousel-actions .secondary-button {
  flex: 1 1 160px;
  justify-content: center;
}

[data-admin-affiliate-carousel-generated-at] {
  color: #67e8f9 !important;
}

@media (max-width: 1180px) {
  .admin-carousel-layout-three {
    grid-template-columns: minmax(280px, 420px) minmax(320px, 1fr);
  }

  .admin-carousel-layout-caption {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .admin-carousel-layout-three {
    grid-template-columns: 1fr;
  }

  .admin-carousel-layout-caption {
    grid-column: auto;
  }
}
