@import '../shared.css';

.kx-admin {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.kx-admin__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.kx-admin__title {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  color: var(--color-neutral-900);
}
.kx-admin__subtitle {
  font-size: var(--fs-body);
  color: var(--color-neutral-500);
  margin-top: 2px;
}
.kx-admin__head-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.kx-admin__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--color-success);
}
.kx-admin__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(14, 138, 95, 0.15);
}

.kx-admin__degraded-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-caption);
  color: var(--color-neutral-500);
  background: var(--color-neutral-050);
  border: var(--border-card);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}

.kx-admin__kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.kx-admin__split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
  align-items: start;
}
.kx-admin__chart {
  width: 100%;
}

.kx-admin__live {
  border: var(--border-card);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  padding: var(--space-4);
}
.kx-admin__live-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.kx-livecard {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border: var(--border-card);
  border-radius: var(--radius-lg);
  background: var(--color-neutral-050);
}
.kx-livecard__thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  background-color: var(--color-neutral-100);
}
.kx-livecard__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kx-livecard__top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.kx-livecard__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.kx-livecard__dot.is-live {
  background: var(--color-error);
  animation: kx-live 1.6s ease-in-out infinite;
}
.kx-livecard__dot.is-prep {
  background: var(--color-violation-warn);
}
@keyframes kx-live {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 45, 32, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(217, 45, 32, 0); }
}
.kx-livecard__state {
  font-size: var(--fs-micro);
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
  color: var(--color-neutral-500);
}
.kx-livecard__title {
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  color: var(--color-neutral-900);
}
.kx-livecard__meta {
  font-size: var(--fs-caption);
  color: var(--color-neutral-500);
}
.kx-livecard__occ {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.kx-livecard__occ .kx-barlist__track {
  flex: 1;
}
.kx-livecard__occ-val {
  font-size: var(--fs-caption);
  color: var(--color-neutral-700);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .kx-admin__kpis {
    grid-template-columns: 1fr;
  }
  .kx-admin__split {
    grid-template-columns: 1fr;
  }
}

/* ── 로그인 슬라이드 관리 (/admin/login-slides) ── */
.kx-slideadm__form {
  padding: var(--space-4) 0 0;
}
.kx-slideadm__form-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-5);
}
@media (max-width: 900px) {
  .kx-slideadm__form-grid {
    grid-template-columns: 1fr;
  }
}
.kx-slideadm__upload {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.kx-slideadm__label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  color: var(--color-neutral-700);
}
.kx-slideadm__upload input[type='file'] {
  font-size: var(--fs-caption);
}
.kx-slideadm__preview {
  height: 150px;
  border: 1px dashed var(--color-neutral-200);
  border-radius: var(--radius-sm);
  background-color: var(--color-neutral-050);
  background-position: center;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-neutral-500);
  font-size: var(--fs-caption);
}
.kx-slideadm__preview.has-image {
  border-style: solid;
}
.kx-slideadm__preview.has-image span {
  display: none;
}
.kx-slideadm__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.kx-slideadm__form-actions {
  display: flex;
  justify-content: flex-end;
}
.kx-slideadm__error {
  color: var(--color-error);
  font-size: var(--fs-caption);
  margin: -4px 0 0;
}
.kx-slideadm__count {
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  color: var(--color-neutral-500);
  margin-left: var(--space-2);
}
.kx-slideadm__skeletons {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}
.kx-slideadm__list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.kx-slideadm__row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-neutral-200);
}
.kx-slideadm__row.is-inactive .kx-slideadm__thumb {
  filter: grayscale(1);
  opacity: 0.55;
}
.kx-slideadm__thumb {
  width: 112px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-neutral-200);
  background-color: var(--color-neutral-050);
  background-position: center;
  background-size: cover;
}
.kx-slideadm__body {
  flex: 1;
  min-width: 0;
}
.kx-slideadm__row-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.kx-slideadm__row-title {
  font-size: var(--fs-body);
  color: var(--color-neutral-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kx-slideadm__live-badge,
.kx-slideadm__off-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
}
.kx-slideadm__live-badge {
  background: rgba(0, 102, 179, 0.1);
  color: var(--color-primary-600);
}
.kx-slideadm__off-badge {
  background: var(--color-neutral-050);
  color: var(--color-neutral-500);
  border: 1px solid var(--color-neutral-200);
}
.kx-slideadm__row-caption {
  font-size: var(--fs-caption);
  color: var(--color-neutral-700);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kx-slideadm__row-meta {
  font-size: var(--fs-micro);
  color: var(--color-neutral-500);
  margin-top: 2px;
}
.kx-slideadm__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}
.kx-slideadm__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-caption);
  color: var(--color-neutral-700);
  cursor: pointer;
  user-select: none;
}
.kx-slideadm__toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary-600);
  cursor: pointer;
}

/* ── 관리 모듈 바로가기 스트립(M18 랜딩) ── */
.kx-admin__modules {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
