:root {
  --bg: #0f1426;
  --panel: #19203a;
  --panel-2: #202842;
  --line: rgba(255, 255, 255, .1);
  --text: #fff;
  --muted: #aeb6cf;
  --accent: #f4c27a;
  --pink: #ff6f8f;
  --green: #62d6a3;
  --danger: #ff6f8f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  color: var(--text);
  background:
    radial-gradient(circle at 76% -8%, rgba(139, 108, 255, .22), transparent 34%),
    radial-gradient(circle at 12% 20%, rgba(244, 194, 122, .1), transparent 30%),
    linear-gradient(180deg, #101426 0%, #11182d 52%, #151a2e 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.admin-app {
  display: grid;
  grid-template-columns: 260px minmax(860px, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(12, 17, 34, .72);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #101426;
  background: linear-gradient(135deg, #ffe1b7, var(--accent));
  font-weight: 1000;
}

.brand-title {
  font-size: 18px;
  font-weight: 950;
}

.brand-subtitle,
.side-label,
.data-dir,
.muted,
.topbar p,
.form-head p {
  color: var(--muted);
}

.brand-subtitle {
  margin-top: 3px;
  font-size: 12px;
}

.side-card {
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .055);
}

.side-label {
  font-size: 12px;
  font-weight: 850;
}

.health {
  margin-top: 8px;
  color: var(--green);
  font-weight: 950;
  word-break: break-all;
}

.data-dir {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.side-nav-item {
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 900;
}

.side-nav-item.active {
  color: #101426;
  background: var(--accent);
}

.muted-item {
  color: var(--muted);
  background: rgba(255, 255, 255, .045);
}

.workspace {
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.page-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: 32px;
  line-height: 1.16;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 12px;
  font-size: 14px;
  color: #dde4ff;
}

.topbar p {
  margin-top: 8px;
}

.top-actions,
.form-actions,
.upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 16px;
}

.stat-card,
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(26, 32, 53, .94), rgba(30, 36, 58, .78));
  box-shadow: 0 16px 38px rgba(0, 0, 0, .18);
}

.stat-card {
  min-height: 92px;
  padding: 18px;
  border-radius: 18px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 430px;
  gap: 16px;
  align-items: start;
}

.panel {
  border-radius: 22px;
}

.library-panel {
  overflow: hidden;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 140px 120px 120px;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

label,
.field {
  display: grid;
  gap: 7px;
  color: #dde4ff;
  font-size: 12px;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, .075);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(244, 194, 122, .58);
  box-shadow: 0 0 0 3px rgba(244, 194, 122, .1);
}

.primary,
.ghost,
.danger {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 950;
}

.primary {
  color: #101426;
  background: linear-gradient(135deg, #ffe1b7, var(--accent));
}

.ghost {
  color: #dde4ff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .1);
}

.danger {
  color: #fff;
  background: rgba(255, 111, 143, .18);
  border: 1px solid rgba(255, 111, 143, .36);
}

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

.table-head,
.pattern-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 140px 90px;
  gap: 12px;
  align-items: center;
}

.table-head {
  padding: 12px 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  border-bottom: 1px solid var(--line);
}

.pattern-table {
  max-height: calc(100vh - 270px);
  overflow: auto;
}

.pattern-row {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .065);
  cursor: pointer;
}

.pattern-row:hover,
.pattern-row.active {
  background: rgba(244, 194, 122, .08);
}

.pattern-main {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.cover {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff7ef;
  border: 1px solid rgba(255, 255, 255, .1);
}

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

.fake-cover {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 10px;
  align-content: center;
}

.fake-cover i {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
}

.row-title {
  font-weight: 950;
}

.row-id,
.row-sub,
.row-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.pill.free {
  color: #101426;
  background: var(--accent);
}

.pill.ad {
  color: #fff;
  background: rgba(255, 111, 143, .32);
  border: 1px solid rgba(255, 111, 143, .42);
}

.pill.featured {
  color: var(--green);
  background: rgba(98, 214, 163, .12);
}

.inspector {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 16px;
}

.preview-card {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.preview-media {
  height: 220px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #fff6fa, #f3f6ff);
  border: 1px solid rgba(255, 255, 255, .1);
}

.preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-top: 14px;
}

.preview-info p {
  margin-top: 6px;
  color: var(--muted);
}

.status-pill {
  flex: 0 0 auto;
  color: #101426;
  background: var(--accent);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 950;
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.swatch-row span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .22);
}

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

.form-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.form-section {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .07);
}

.grid {
  display: grid;
  gap: 10px;
}

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

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

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding-top: 18px;
}

.toggle-label input {
  width: auto;
}

.upload-row {
  align-items: end;
}

.upload-box {
  flex: 0 0 132px;
  height: 62px;
  border: 1px dashed rgba(244, 194, 122, .48);
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(244, 194, 122, .08);
  cursor: pointer;
}

.upload-box input {
  display: none;
}

.grow {
  flex: 1;
}

.empty-state {
  padding: 34px 16px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: 380px;
  padding: 13px 16px;
  border-radius: 14px;
  color: #101426;
  background: var(--accent);
  font-weight: 950;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24);
}

@media (max-width: 1180px) {
  body {
    min-width: 0;
  }

  .admin-app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .inspector {
    position: static;
    max-height: none;
  }
}
