:root {
  --text: #050505;
  --muted: #6f7076;
  --line: #e7e8ec;
  --soft: #f4f5f7;
  --panel: #ffffff;
  --black: #050505;
  --radius: 8px;
  --mono: "SF Mono", "Roboto Mono", "Cascadia Mono", Menlo, monospace;
  --sans: Inter, Manrope, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: #f6f7f9;
  font-family: var(--sans);
  letter-spacing: 0;
}

.is-hidden {
  display: none !important;
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 28% 32%, rgba(210, 255, 62, 0.62), transparent 23%),
    radial-gradient(circle at 72% 22%, rgba(244, 164, 232, 0.66), transparent 28%),
    #fff7ff;
}

.admin-login.is-hidden {
  display: none;
}

.admin-login-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(31, 22, 34, 0.12);
}

.admin-login-panel h1 {
  margin: 0 0 28px;
  font-size: 42px;
  line-height: 0.98;
  letter-spacing: 0;
}

.admin-login-panel .dark-button {
  width: 100%;
  margin-top: 14px;
}

.login-status {
  min-height: 18px;
  margin: 12px 0 0;
  color: #a52121;
  font-size: 12px;
  line-height: 1.4;
}

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

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

button {
  cursor: pointer;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px 1fr;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-right: 1px solid var(--line);
  background: #ffffff;
  padding: 18px 14px;
}

.admin-logo {
  display: inline-flex;
  align-items: center;
  height: 40px;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.admin-tabs {
  display: grid;
  align-content: start;
  gap: 8px;
  margin-top: 28px;
}

.admin-tabs button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  padding: 0 12px;
  color: #2b2c30;
  text-align: left;
  font-weight: 800;
}

.admin-tabs button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #ededf0;
  color: #050505;
  font-family: var(--mono);
  font-size: 12px;
}

.admin-tabs button.is-active {
  background: #050505;
  color: white;
}

.admin-tabs button.is-active span {
  background: white;
}

.sidebar-note {
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 15% 20%, rgba(200, 255, 250, 0.9), transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(246, 114, 235, 0.42), transparent 36%),
    linear-gradient(135deg, #eaffff, #f6e7ff);
  padding: 14px;
}

.sidebar-note p {
  margin: 0;
  font-weight: 850;
  line-height: 1.12;
}

.sidebar-note span {
  display: block;
  margin-top: 10px;
  color: #55565c;
  font-size: 12px;
  line-height: 1.35;
}

.admin-main {
  min-width: 0;
  padding: 22px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.admin-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 40px;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.save-status {
  max-width: 260px;
  color: #5b5d64;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.3;
  text-align: right;
  text-transform: uppercase;
}

.save-status.is-error {
  color: #b52323;
}

.ghost-button,
.dark-button,
.panel-title button,
.section-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: var(--radius);
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.ghost-button,
.panel-title button,
.section-actions button {
  border: 1px solid var(--line);
  background: white;
}

.dark-button {
  border: 0;
  background: #050505;
  color: white;
}

.admin-view {
  display: none;
}

.admin-view.is-active {
  display: block;
}

.pages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
}

.page-browser,
.editor-panel,
.preview-panel,
.page-form,
.section-builder,
.orders-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.page-browser {
  min-height: calc(100vh - 104px);
  max-height: calc(100vh - 104px);
  overflow: auto;
  padding: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
}

.panel-title a {
  color: var(--muted);
  font-size: 11px;
}

.page-list {
  display: grid;
  gap: 18px;
}

.page-group {
  display: grid;
  gap: 7px;
}

.page-group-title {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.page-item {
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: #f5f5f7;
  padding: 12px;
  text-align: left;
}

.page-item.is-active {
  background: #050505;
  color: white;
}

.page-item strong {
  display: block;
  font-size: 15px;
}

.page-item span {
  display: block;
  margin-top: 5px;
  color: inherit;
  opacity: 0.66;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.editor-panel {
  min-width: 0;
  padding: 14px;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
}

.page-form,
.preview-panel,
.section-builder {
  padding: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
  color: var(--text);
  padding: 11px 12px;
  outline: 2px solid transparent;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline-color: #050505;
}

.status-pill {
  border-radius: 999px;
  background: #f0f1f4;
  padding: 6px 10px;
  color: #55565c;
}

.page-preview {
  min-height: 324px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #f5f5f7;
}

.preview-hero {
  min-height: 150px;
  padding: 22px;
}

.preview-hero h2 {
  margin: 12px 0 0;
  font-size: 30px;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.preview-hero p,
.preview-card p {
  color: #5e6067;
  font-size: 13px;
  line-height: 1.35;
}

.preview-cards {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.preview-card {
  border-radius: var(--radius);
  background: white;
  padding: 12px;
}

.preview-card strong {
  display: block;
  margin-bottom: 6px;
}

.section-builder {
  margin-top: 14px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sections-list {
  display: grid;
  gap: 10px;
}

.section-editor {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbfc;
  padding: 12px;
}

.section-meta {
  display: grid;
  gap: 8px;
  align-content: start;
}

.section-number {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #050505;
  color: white;
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: 11px;
}

.section-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.section-fields .wide-field {
  grid-column: 1 / -1;
}

.project-editor-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.project-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

.project-editor-heading > div {
  display: grid;
  gap: 3px;
}

.project-editor-heading span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.project-editor-heading button,
.project-media-actions button,
.project-order-actions button,
.project-upload {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.project-editor {
  position: relative;
  display: grid;
  grid-template-columns: 190px 1fr 40px;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.project-media-editor {
  display: grid;
  align-content: start;
  gap: 8px;
}

.project-image-preview {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: #eceef1;
}

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

.project-image-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.project-image-placeholder span {
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.74);
  padding: 8px 10px;
  color: #34353a;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.project-media-actions {
  display: grid;
  gap: 6px;
}

.project-upload {
  display: grid;
  place-items: center;
  cursor: pointer;
}

.project-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.project-upload.is-loading span {
  opacity: 0.45;
}

.project-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-content: start;
  gap: 10px;
}

.project-fields textarea {
  min-height: 76px;
}

.project-order-actions {
  display: grid;
  align-content: start;
  gap: 6px;
}

.project-order-actions button {
  width: 40px;
  padding: 0;
}

.project-order-actions button:disabled {
  cursor: default;
  opacity: 0.35;
}

.project-order-actions .danger-button {
  min-height: 72px;
  color: #a52121;
  font-size: 0;
}

.project-order-actions .danger-button::before {
  content: "×";
  font-size: 20px;
}

.project-empty {
  min-height: 100px;
  display: grid;
  place-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.orders-layout {
  display: grid;
  gap: 14px;
}

.orders-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.orders-summary article {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 16px;
}

.orders-summary span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
}

.orders-summary strong {
  display: block;
  margin-top: 18px;
  font-size: 44px;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.orders-panel {
  padding: 14px;
}

.orders-list {
  display: grid;
  gap: 10px;
}

.order-card,
.empty-state {
  border-radius: var(--radius);
  background: #f5f5f7;
  padding: 14px;
}

.order-card {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 18px;
}

.order-card h3 {
  margin: 0;
}

.order-card p {
  margin: 7px 0 0;
  color: #55565c;
  line-height: 1.35;
}

.order-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--mono);
  text-transform: uppercase;
}

.empty-state {
  min-height: 190px;
  display: grid;
  place-items: center;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.empty-state p {
  max-width: 420px;
  margin: 10px auto 0;
  color: var(--muted);
  line-height: 1.4;
}

.gradient-pink-lime {
  background:
    radial-gradient(circle at 46% 58%, rgba(205, 255, 44, 0.72) 0 9%, transparent 20%),
    radial-gradient(circle at 67% 34%, rgba(255, 190, 226, 0.76), transparent 28%),
    linear-gradient(120deg, #fff8ff 0%, #fff3ff 46%, #ffe6f6 100%);
}

.gradient-cyan-violet {
  background:
    radial-gradient(circle at 15% 17%, rgba(200, 255, 250, 0.85), transparent 30%),
    radial-gradient(circle at 86% 9%, rgba(246, 114, 235, 0.42), transparent 35%),
    linear-gradient(125deg, #dffcff 0%, #f4efff 48%, #f3d4ff 100%);
}

.gradient-violet-mint {
  background:
    radial-gradient(circle at 12% 54%, rgba(240, 90, 225, 0.46), transparent 27%),
    radial-gradient(circle at 76% 24%, rgba(202, 249, 255, 0.9), transparent 32%),
    linear-gradient(125deg, #efd9ff 0%, #f4f1ff 48%, #cdfcf9 100%);
}

.gradient-white {
  background: #ffffff;
}

.project-image-placeholder.media-orange {
  background: linear-gradient(135deg, #ff8500, #ffb22c);
}

.project-image-placeholder.media-lilac {
  background: linear-gradient(135deg, #efd8ff, #e8f8ff);
}

.project-image-placeholder.media-soft {
  background: linear-gradient(135deg, #f7efdf, #e5f4e8);
}

.project-image-placeholder.media-green {
  background: linear-gradient(135deg, #00dc91, #38d832);
}

.project-image-placeholder.media-blue {
  background: linear-gradient(135deg, #b9f3ff, #53cbff);
}

.project-image-placeholder.media-yellow {
  background: linear-gradient(135deg, #f8d646, #3d8eff);
}

@media (max-width: 1120px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
  }

  .admin-tabs {
    display: flex;
    margin-top: 0;
  }

  .sidebar-note {
    grid-column: 1 / -1;
  }

  .pages-layout,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .page-browser {
    min-height: auto;
    max-height: none;
  }
}

@media (max-width: 680px) {
  .admin-main {
    padding: 14px;
  }

  .admin-topbar,
  .topbar-actions,
  .section-editor,
  .project-editor,
  .order-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .form-grid,
  .section-fields,
  .project-fields,
  .orders-summary {
    grid-template-columns: 1fr;
  }

  .save-status {
    max-width: none;
    text-align: left;
  }

  .project-order-actions {
    display: flex;
  }

  .project-order-actions .danger-button {
    min-height: 36px;
  }
}
