:root {
  --bg: #0f1115;
  --panel: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.08);

  --text: #ffffff;
  --muted: #9ca3af;

  --accent: #6d5dfc;
  --accent-hover: #5a49ff;

  --radius: 18px;
}

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

body {
  background: var(--bg);
  color: var(--text);

  font-family: Inter, sans-serif;
  min-height: 100vh;
}

/* TOPBAR */

.topbar {
  height: 80px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 0 40px;

  border-bottom: 1px solid var(--border);

  backdrop-filter: blur(20px);
}

.topbar p {
  color: var(--muted);
  margin-top: 5px;
}

.back-btn {
  color: white;
  text-decoration: none;

  padding: 12px 18px;

  border-radius: 12px;

  background: rgba(255,255,255,0.06);

  transition: 0.3s;
}

.back-btn:hover {
  background: rgba(255,255,255,0.12);
}

/* LAYOUT */

.layout {
  display: grid;
  grid-template-columns: 400px 1fr;

  gap: 25px;

  padding: 25px;

  height: calc(100vh - 80px);
}

/* SIDEBAR */

.sidebar {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* PANELS */

.panel,
.preview-card,
.code-card {
  background: var(--panel);

  border: 1px solid var(--border);

  border-radius: var(--radius);

  padding: 22px;

  backdrop-filter: blur(18px);
}

.panel h2 {
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* FORM GRID */

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

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

label {
  font-size: 14px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;

  padding: 14px;

  border: 1px solid var(--border);

  border-radius: 12px;

  background: rgba(255,255,255,0.04);

  color: white;

  outline: none;

  transition: 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

/* BUTTONS */

button {
  border: none;
  cursor: pointer;

  transition: 0.2s ease;
}

.primary-btn,
.full-btn {
  background: var(--accent);
  color: white;

  padding: 14px 18px;

  border-radius: 12px;

  font-weight: 600;
}

.primary-btn:hover,
.full-btn:hover {
  background: var(--accent-hover);
}

.full-btn {
  width: 100%;
  margin-top: 20px;
}

/* FIELD ITEMS */

.field-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.field-item {
  background: rgba(255,255,255,0.04);

  border: 1px solid var(--border);

  padding: 16px;

  border-radius: 16px;

  display: grid;
  gap: 12px;
}

.delete-btn {
  background: #ff4d4d;
  color: white;

  padding: 10px;

  border-radius: 10px;
}

/* PREVIEW */

.preview-area {
  display: flex;
  flex-direction: column;
  gap: 20px;

  overflow: hidden;
}

.preview-box {
  min-height: 350px;
}

/* TABS */

.tabs {
  display: flex;
  gap: 10px;

  margin-bottom: 20px;
}

.tab {
  background: rgba(255,255,255,0.06);

  color: white;

  padding: 12px 18px;

  border-radius: 10px;
}

.tab.active {
  background: var(--accent);
}

/* CODE */

.code-section {
  display: none;
}

.code-section.active {
  display: block;
}

pre {
  overflow: auto;

  padding: 20px;

  border-radius: 16px;

  background: #050505;
}

/* RESPONSIVE */

@media (max-width: 980px) {

  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

}