:root {
  color-scheme: dark;
  --black: #0b0b0c;
  --black-soft: #121214;
  --gold: #d3b062;
  --gold-soft: #f1e1b1;
  --white: #f8f7f2;
  --gray: #a3a3a3;
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.admin-header {
  text-align: center;
  padding: 20px 12px;
  border-bottom: 2px solid rgba(211, 176, 98, 0.4);
  background: var(--black-soft);
}

.admin-header h1 {
  font-size: 1.4rem;
  letter-spacing: 1px;
}

.admin-shell {
  width: min(1600px, 96%);
  margin: 24px auto 40px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 0;
  background: #111;
}

.admin-sidebar {
  padding: 20px 16px;
  border-right: 2px solid rgba(255, 255, 255, 0.12);
}

.admin-main {
  padding: 20px 16px;
  display: grid;
  gap: 24px;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.sidebar-header h2 {
  font-size: 1.2rem;
  letter-spacing: 1px;
}

.sidebar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 1.1rem;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(211, 176, 98, 0.18);
  color: var(--gold-soft);
  font-size: 0.75rem;
}

.badge-muted {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gray);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.btn-gold {
  background: var(--gold);
  color: #1a1814;
}

.btn-outline {
  border: 1px solid rgba(211, 176, 98, 0.4);
  background: transparent;
  color: var(--gold-soft);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--white);
}

.tree-list {
  display: grid;
  gap: 12px;
}

.tree-group {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.tree-group.active {
  border-color: rgba(211, 176, 98, 0.5);
}

.tree-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tree-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
}

.tree-row strong {
  font-size: 0.95rem;
}

.tree-caret {
  display: inline-flex;
  transition: transform 0.2s ease;
  color: var(--gray);
}

.tree-caret.open {
  transform: rotate(90deg);
}

.tree-group.active {
  border-color: rgba(211, 176, 98, 0.8);
  box-shadow: 0 0 0 1px rgba(211, 176, 98, 0.25);
}
.tree-row button {
  background: transparent;
  border: none;
  color: var(--gray);
  cursor: pointer;
  font-size: 0.85rem;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.tree-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tree-templates {
  margin-top: 8px;
  padding-left: 12px;
  display: grid;
  gap: 6px;
}

.tree-template {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.tree-template.active {
  background: rgba(211, 176, 98, 0.22);
  border: 1px solid rgba(211, 176, 98, 0.5);
}

.tree-template.active {
  background: rgba(211, 176, 98, 0.12);
}

.tree-template button {
  background: transparent;
  border: none;
  color: var(--gray);
  cursor: pointer;
  font-size: 0.8rem;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--gray);
  margin-bottom: 6px;
}

.form-field input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  color: var(--white);
  font-size: 0.95rem;
}

.form-field input:focus {
  outline: 1px solid rgba(211, 176, 98, 0.7);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.preview-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(211, 176, 98, 0.4);
  background: transparent;
  color: var(--gold-soft);
  font-size: 1.4rem;
  cursor: pointer;
}

.preview-strip {
  display: grid;
  grid-template-columns: 0.75fr 1.8fr 0.75fr;
  gap: 20px;
  align-items: center;
}

.preview-box {
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  text-align: center;
  padding: 18px;
  color: var(--gray);
  min-height: 150px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.preview-box.small {
  min-height: 120px;
  padding: 12px;
}

.preview-box.large {
  min-height: 360px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.preview-title-box {
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--white);
}

.preview-frame {
  min-height: 260px;
  min-width: 500px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  place-items: center;
}

.preview-body {
  background: #e9eaee;
  color: #131313;
}

.preview-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.preview-card {
  width: min(500px, 100%);
  background: #f8f6f1;
  border-radius: 30px;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  position: relative;
}

.preview-header {
  background: #111112;
  height: 120px;
}

.preview-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #ffffff;
  border: 6px solid #f8f6f1;
  margin: -56px auto 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #111112;
  font-size: 1.4rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.preview-title {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #171717;
}

.preview-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  margin-top: 4px;
}

.preview-actions {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.contact-item {
  background: #ffffff;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-item span {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
}

.contact-item small {
  display: block;
  color: #666;
  font-weight: 400;
}

.contact-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(211, 176, 98, 0.18);
  color: #9a7a35;
  font-weight: 700;
}

.empty-state {
  color: #666;
  font-size: 0.95rem;
}

.form-panel {
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 16px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.6);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--black-soft);
  padding: 24px;
  border-radius: var(--radius-md);
  width: min(360px, 100%);
  box-shadow: var(--shadow);
}

.modal-label {
  display: block;
  margin: 12px 0 6px;
  color: var(--gray);
}

.modal-content input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

@media (min-width: 900px) {
  .admin-shell {
    grid-template-columns: 280px 1fr;
  }

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

  .form-actions {
    grid-column: span 2;
  }
}
