:root {
  color-scheme: light;
  --bg: #f7f3e8;
  --panel: #ffffff;
  --panel-soft: #fffaf0;
  --ink: #17130f;
  --muted: #6d6255;
  --line: #eadfc8;
  --accent: #f3c316;
  --accent-dark: #8a6500;
  --gold-soft: #fff4bf;
  --black: #171313;
  --warn: #b45309;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(31, 24, 9, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(243, 195, 22, 0.18), transparent 34%),
    linear-gradient(180deg, #fffaf0 0%, var(--bg) 58%, #efe4cb 100%);
  color: var(--ink);
}

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

button {
  border: 0;
  border-radius: 7px;
  background: var(--black);
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
}

button:hover {
  background: #2a2320;
}

button.secondary {
  background: var(--gold-soft);
  color: var(--ink);
}

button.secondary:hover {
  background: #f8df70;
}

button.approve {
  background: var(--accent);
  color: var(--black);
}

button.approve:hover {
  background: #ffd928;
}

button.danger-action {
  background: #fff1ed;
  color: var(--danger);
}

button.danger-action:hover {
  background: #ffd8cf;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(243, 195, 22, 0.2);
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #103d2c;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-logo {
  width: min(280px, 100%);
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.login-logo {
  width: min(260px, 100%);
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.side-logo {
  width: 140px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: left center;
  background: #fff;
  border-radius: 6px;
  padding: 4px;
}

.submit-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(280px, 360px);
  gap: 24px;
  align-items: start;
  padding: 48px;
}

.submit-panel,
.submit-aside,
.login-card,
.queue-panel,
.detail-panel,
.metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.submit-panel {
  padding: 32px;
}

.brand-row,
.side-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.brand-row h1,
.login-card h1,
.topbar h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.brand-row p,
.login-card p,
.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.form-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.span-2 {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.message {
  margin: 0;
  min-height: 22px;
  color: var(--accent-dark);
  font-weight: 700;
}

.message.error {
  color: var(--danger);
}

.submit-aside {
  padding: 26px;
}

.submit-aside h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.submit-aside ul {
  padding-left: 20px;
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(420px, 100%);
  padding: 30px;
  display: grid;
  gap: 18px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  background: var(--black);
  color: #fff7db;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.side-brand {
  font-weight: 800;
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
}

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

.nav-item,
.side-link {
  width: 100%;
  display: block;
  text-align: left;
  border-radius: 7px;
  padding: 11px 12px;
  background: transparent;
  color: #efe1b3;
  min-height: 0;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active,
.side-link:hover {
  background: rgba(243, 195, 22, 0.16);
  color: var(--accent);
}

.workspace {
  padding: 26px;
  min-width: 0;
}

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

.top-actions {
  display: flex;
  gap: 10px;
  min-width: 420px;
}

.metrics {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 18px;
}

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

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.work-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.4fr);
  gap: 18px;
  align-items: start;
}

.queue-panel,
.detail-panel {
  min-height: 640px;
}

.panel-head {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
}

.product-list {
  display: grid;
  max-height: 70vh;
  overflow: auto;
}

.product-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.product-row:hover,
.product-row.active {
  background: var(--panel-soft);
}

.thumb {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #f4ead0;
}

.row-title {
  margin: 0 0 8px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
  background: var(--gold-soft);
  color: #7a5800;
}

.status.pending_review {
  background: #fff7df;
  color: var(--warn);
}

.status.needs_revision {
  background: #fee4e2;
  color: var(--danger);
}

.status.published {
  background: #191515;
  color: var(--accent);
}

.detail-panel {
  padding: 20px;
}

.empty-state {
  height: 600px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.detail-head h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 14px 0 20px;
}

.image-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
}

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

.raw-note,
.copy-box {
  padding: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #3d342b;
  line-height: 1.55;
}

.copy-box {
  white-space: pre-wrap;
  min-height: 160px;
}

.detail-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 980px) {
  .submit-shell,
  .app-shell,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .submit-shell,
  .workspace {
    padding: 18px;
  }

  .sidebar {
    position: static;
  }

  .topbar,
  .top-actions {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
  }

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

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

  .span-2 {
    grid-column: auto;
  }

  .brand-logo,
  .login-logo {
    width: 180px;
    max-width: 100%;
  }
}
