@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

.pe-admin {
  --pe-bg: #f5f8ff;
  --pe-surface: #ffffff;
  --pe-surface-soft: #f8fbff;
  --pe-text: #1e293b;
  --pe-heading: #1f2f46;
  --pe-muted: #64748b;
  --pe-border: #dbe4f2;
  --pe-accent: #2563eb;
  --pe-accent-soft: #dbeafe;
  --pe-accent-2: #60a5fa;
  --pe-success: #059669;
  --pe-success-soft: #d1fae5;
  --pe-danger: #dc2626;
  --pe-danger-soft: #fee2e2;
  --pe-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --pe-shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.05);
  max-width: 1150px;
  margin: 0 auto;
  padding: 12px 12px 28px;
  color: var(--pe-text);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pe-admin * {
  box-sizing: border-box;
}

.pe-admin h2,
.pe-admin h3,
.pe-pinpas-box h3,
.pe-pinpas-change-box h3 {
  margin: 0;
  color: var(--pe-heading);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.pe-admin h2 {
  max-width: 560px;
  font-size: clamp(1.8rem, 2.2vw, 2.15rem);
}

.pe-admin h3,
.pe-pinpas-box h3,
.pe-pinpas-change-box h3 {
  font-size: clamp(1.25rem, 1.65vw, 1.55rem);
  line-height: 1.08;
}

.pe-section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 7px 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  background: rgba(219, 234, 254, 0.55);
  color: var(--pe-accent);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pe-section-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pe-accent), var(--pe-accent-2));
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12);
}

.pe-hero-card,
.pe-surface-card,
.pe-pinpas-box,
.pe-pinpas-change-box,
.pe-parent-zone-box,
.pe-feedback-card,
.pe-empty-state {
  border: 1px solid var(--pe-border);
  border-radius: 18px;
  background: var(--pe-surface);
  box-shadow: var(--pe-shadow);
}

.pe-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 32px;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding: 24px 28px;
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.14), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.pe-hero-main {
  min-width: 0;
  max-width: 760px;
}

.pe-hero-card::after {
  content: "";
  position: absolute;
  inset: auto -120px -160px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12), transparent 70%);
  pointer-events: none;
}

.pe-hero-copy {
  max-width: 700px;
  margin: 10px 0 0;
  color: var(--pe-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.pe-parent-chip,
.pe-count-pill,
.pe-course-pill,
.pe-status-pill,
.pe-action-link,
.pe-btn-cancel,
.pe-admin .button,
.pe-admin button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.pe-parent-chip,
.pe-count-pill {
  flex-shrink: 0;
  padding: 10px 14px;
  border: 1px solid var(--pe-border);
  background: var(--pe-surface-soft);
  color: var(--pe-muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}

.pe-parent-chip strong {
  color: var(--pe-text);
}

.pe-parent-zone-box {
  margin-bottom: 24px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  color: var(--pe-text);
  font-size: 0.88rem;
  line-height: 1.55;
  box-shadow: var(--pe-shadow-soft);
}

.pe-parent-zone-box strong {
  color: var(--pe-accent);
}

.pe-pinpas-box,
.pe-pinpas-change-box,
.pe-surface-card {
  margin-bottom: 24px;
  padding: 22px 24px;
}

.pe-pinpas-box > p:not(.pe-section-eyebrow),
.pe-pinpas-change-box > p:not(.pe-section-eyebrow) {
  margin: 10px 0 0;
  color: var(--pe-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.pe-surface-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.pe-form {
  margin: 0;
}

.pe-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.pe-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pe-form-full {
  grid-column: 1 / -1;
}

.pe-form-group label,
.pe-form-group label strong {
  color: var(--pe-text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pe-form input[type="text"],
.pe-form input[type="date"],
.pe-form input[type="password"],
.pe-form select,
.pe-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--pe-border);
  border-radius: 14px;
  background: #fff;
  color: var(--pe-text);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.pe-form textarea {
  min-height: 108px;
  resize: vertical;
}

.pe-form select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--pe-accent) 50%),
    linear-gradient(135deg, var(--pe-accent) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 24px) calc(50% - 3px),
    calc(100% - 18px) calc(50% - 3px),
    100% 0;
  background-size: 6px 6px, 6px 6px, 2.5em 2.5em;
  background-repeat: no-repeat;
  padding-right: 42px;
}

.pe-form input:focus,
.pe-form select:focus,
.pe-form textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.pe-form input:disabled,
.pe-form select:disabled,
.pe-form textarea:disabled {
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
}

.pe-char-counter {
  color: var(--pe-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.pe-avatar-group {
  padding: 16px 18px;
  border: 1px dashed rgba(37, 99, 235, 0.24);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.6) 0%, #ffffff 100%);
}

.pe-avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.pe-avatar-preview {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border-radius: 24px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(219, 234, 254, 0.48);
  color: var(--pe-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
}

.pe-avatar-preview.has-image {
  background: #fff;
}

.pe-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pe-avatar-upload-copy {
  flex: 1 1 280px;
}

.pe-avatar-upload-copy .description {
  margin: 8px 0 0;
  color: var(--pe-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.pe-table-avatar {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: rgba(219, 234, 254, 0.48);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--pe-accent);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.pe-table-avatar.has-image {
  background: #fff;
}

.pe-table-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pe-table-avatar-placeholder {
  text-transform: uppercase;
}

.pe-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pe-admin button[type="submit"],
.pe-admin .button-primary {
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  background: linear-gradient(135deg, var(--pe-accent) 0%, var(--pe-accent-2) 100%);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.2);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.pe-admin button[type="submit"]:hover:not(:disabled),
.pe-admin .button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
  filter: saturate(1.1);
}

.pe-admin button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.pe-btn-cancel,
.pe-admin .button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--pe-border);
  background: #fff;
  color: var(--pe-text);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.pe-btn-cancel:hover,
.pe-admin .button:hover {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  color: var(--pe-text);
}

.pe-limit-notice,
.pe-feedback-card {
  margin-bottom: 24px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.pe-limit-notice {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
}

.pe-feedback-card-error {
  border-color: rgba(220, 38, 38, 0.2);
  background: var(--pe-danger-soft);
  color: #991b1b;
  box-shadow: var(--pe-shadow-soft);
}

.pe-admin .notice {
  margin: 0 0 24px;
  padding: 12px 16px;
  border: 1px solid var(--pe-border);
  border-left: 4px solid var(--pe-accent);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--pe-shadow-soft);
}

.pe-table-shell {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid var(--pe-border);
  background: #fff;
}

.pe-children-table {
  width: 100%;
  min-width: 1200px;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  background: #fff;
}

.pe-children-table thead th {
  padding: 14px 14px;
  border-bottom: 1px solid var(--pe-border);
  background: #f8fbff;
  color: var(--pe-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.pe-children-table tbody td {
  padding: 14px;
  border-bottom: 1px solid rgba(219, 228, 242, 0.7);
  color: var(--pe-text);
  font-size: 0.88rem;
  vertical-align: top;
}

.pe-row-active {
  background: linear-gradient(90deg, rgba(236, 253, 245, 0.72), #ffffff 32%);
}

.pe-row-inactive {
  background: linear-gradient(90deg, rgba(254, 242, 242, 0.8), #ffffff 32%);
}

.pe-child-name {
  display: inline-block;
  color: var(--pe-text);
  font-size: 0.9rem;
  font-weight: 800;
}

.pe-course-pill,
.pe-status-pill {
  padding: 10px 14px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pe-course-pill {
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(219, 234, 254, 0.65);
  color: var(--pe-accent);
}

.pe-status-pill.is-active {
  background: var(--pe-success-soft);
  color: #065f46;
}

.pe-status-pill.is-inactive {
  background: var(--pe-danger-soft);
  color: #991b1b;
}

.pe-note-cell {
  display: inline-block;
  max-width: 240px;
  color: var(--pe-muted);
  line-height: 1.6;
  cursor: help;
}

.pe-note-cell:hover,
.pe-note-cell:focus-visible {
  color: var(--pe-text);
}

.pe-actions-cell {
  white-space: nowrap;
}

.pe-action-link {
  width: 36px;
  height: 36px;
  margin-right: 6px;
  border: 1px solid var(--pe-border);
  background: #fff;
  color: var(--pe-text);
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.pe-action-link:hover {
  border-color: rgba(37, 99, 235, 0.32);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.pe-feather-trail-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

.pe-feather-particle {
  position: fixed;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #8b9dff;
  line-height: 1;
  opacity: 0;
  text-shadow:
    0 0 6px rgba(139, 157, 255, 0.75),
    0 0 14px rgba(96, 165, 250, 0.45);
  transform: translate3d(-50%, -50%, 0) rotate(-8deg) scale(0.75);
  animation: pe-feather-drift 860ms ease-out forwards;
  will-change: transform, opacity;
}

@keyframes pe-feather-drift {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) rotate(-8deg) scale(0.7);
  }

  18% {
    opacity: 0.95;
  }

  100% {
    opacity: 0;
    transform:
      translate3d(
        calc(-50% + var(--pe-feather-drift-x, 0px)),
        calc(-50% + var(--pe-feather-drift-y, 32px)),
        0
      )
      rotate(18deg)
      scale(1);
  }
}

.pe-empty-state {
  padding: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: var(--pe-shadow-soft);
}

.pe-empty-title {
  margin: 0;
  color: var(--pe-text);
  font-size: 0.98rem;
  font-weight: 800;
}

.pe-empty-copy {
  margin: 8px 0 0;
  color: var(--pe-muted);
  line-height: 1.7;
}

@media (max-width: 900px) {
  .pe-admin {
    padding: 8px 0 24px;
  }

  .pe-hero-card,
  .pe-surface-card,
  .pe-pinpas-box,
  .pe-pinpas-change-box {
    padding: 18px 16px;
    border-radius: 16px;
  }

  .pe-hero-card {
    grid-template-columns: 1fr;
  }

  .pe-surface-head {
    flex-direction: column;
  }

  .pe-form-grid {
    grid-template-columns: 1fr;
  }

  .pe-count-pill,
  .pe-parent-chip,
  .pe-form-actions,
  .pe-admin button[type="submit"],
  .pe-btn-cancel {
    width: 100%;
  }

  .pe-table-shell {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .pe-children-table {
    min-width: 0;
  }

  .pe-children-table thead {
    display: none;
  }

  .pe-children-table,
  .pe-children-table tbody,
  .pe-children-table tr,
  .pe-children-table td {
    display: block;
    width: 100%;
  }

  .pe-children-table tr {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--pe-border);
    border-radius: 16px;
    box-shadow: var(--pe-shadow-soft);
  }

  .pe-children-table tbody td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(219, 228, 242, 0.7);
    text-align: right;
  }

  .pe-children-table tbody td:last-child {
    border-bottom: 0;
  }

  .pe-children-table td::before {
    content: attr(data-label);
    color: var(--pe-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-align: left;
    text-transform: uppercase;
  }

  .pe-note-cell {
    max-width: 60%;
    text-align: right;
  }

  .pe-avatar-upload-row {
    align-items: flex-start;
  }

  .pe-actions-cell {
    justify-content: flex-end;
  }

  .pe-actions-cell::before {
    align-self: center;
  }
}
