:root {
  color-scheme: dark;
  --black: #070706;
  --ink: #f4f0e8;
  --paper: #f6f2ea;
  --muted: #b8b1a8;
  --line: rgba(246, 242, 234, 0.16);
  --line-strong: rgba(246, 242, 234, 0.28);
  --panel: rgba(18, 17, 16, 0.9);
  --champagne: #c8ad73;
  --champagne-soft: #eadbb9;
  --error: #f0a49b;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    linear-gradient(90deg, rgba(246, 242, 234, 0.035) 1px, transparent 1px),
    #070706;
  background-size: 72px 72px;
  color: var(--ink);
}

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

a {
  color: inherit;
}

.admin-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(7, 7, 6, 0.92);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 38px;
  font-family: "IBM Plex Sans", Inter, sans-serif;
  font-weight: 700;
  text-decoration: none;
}

.brand-symbol {
  width: 34px;
  height: 34px;
  border-left: 8px solid var(--paper);
  border-bottom: 4px solid var(--champagne);
  position: relative;
}

.brand-symbol::after {
  content: "";
  position: absolute;
  inset: 7px 8px 7px 12px;
  border-right: 7px solid var(--champagne);
  transform: skew(-20deg);
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar a {
  color: var(--muted);
  text-decoration: none;
}

.sidebar nav a {
  padding: 10px 0;
  border-bottom: 1px solid rgba(246, 242, 234, 0.08);
}

.sidebar a:hover {
  color: var(--paper);
}

.login-view {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 30px;
}

.login-box,
.panel {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
}

.login-box {
  max-width: 440px;
  padding: 30px;
}

.dashboard {
  width: min(1120px, calc(100% - 44px));
  margin: 0 auto;
  padding: 38px 0 70px;
}

.dashboard-header,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-header {
  margin-bottom: 24px;
}

.panel {
  margin-bottom: 22px;
  padding: 24px;
}

.panel-heading {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--champagne);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  font-family: "IBM Plex Sans", Inter, sans-serif;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.4rem);
}

h3.form-section {
  grid-column: 1 / -1;
  margin: 10px 0 2px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--champagne-soft);
  font-size: 1.05rem;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.login-box label {
  margin-bottom: 16px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(246, 242, 234, 0.06);
  color: var(--paper);
  padding: 13px 14px;
}

input[type="color"] {
  min-height: 48px;
  padding: 5px;
  cursor: pointer;
}

input[type="number"] {
  max-width: 220px;
}

textarea {
  resize: vertical;
}

textarea.tall {
  min-height: 180px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(200, 173, 115, 0.42);
  outline-offset: 1px;
}

select option {
  color: #111;
}

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

.hint {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.45;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  background: var(--paper);
  color: var(--black);
}

.button.secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--paper);
}

.button:disabled {
  opacity: 0.5;
  cursor: default;
}

.status {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--champagne-soft);
}

.status.error {
  color: var(--error);
}

.upload-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.media-preview-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(246, 242, 234, 0.045);
}

.media-preview-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(246, 242, 234, 0.12);
  border-radius: 6px;
  background: #f6f2ea;
  object-fit: contain;
}

.media-preview-card strong,
.media-preview-card span,
.media-preview-card code {
  min-width: 0;
}

.media-preview-card span {
  color: var(--champagne-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.media-preview-card code {
  overflow: hidden;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.lead-item {
  border: 1px solid var(--line);
  padding: 16px;
  background: rgba(246, 242, 234, 0.04);
}

.lead-item header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  color: var(--champagne-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
}

.lead-item strong {
  display: block;
  margin-bottom: 6px;
}

.lead-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar nav {
    grid-template-columns: repeat(5, auto);
    justify-content: start;
    gap: 14px;
  }

  .form-grid,
  .upload-row,
  .media-preview-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    display: grid;
  }

  .upload-row {
    display: grid;
  }
}

@media (max-width: 620px) {
  .dashboard {
    width: min(100% - 28px, 1120px);
  }

  .dashboard-header,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .sidebar nav {
    grid-template-columns: repeat(2, auto);
  }
}
