:root {
  --red: #bd0303;
  --red-dark: #7d0000;
  --black: #111111;
  --carbon: #1d1d1d;
  --muted: #666666;
  --white: #ffffff;
  --paper: #f6f3f1;
  --line: rgba(0, 0, 0, 0.14);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--carbon);
  background: var(--paper);
  font-family: Inter, Montserrat, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

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

button,
a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid transparent;
  padding: 0 18px;
  color: var(--white);
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

button.secondary,
a.secondary,
.dashboard-header a {
  color: var(--black);
  border-color: var(--line);
  background: var(--white);
}

button.danger {
  background: var(--black);
}

.facebook-share {
  gap: 8px;
  white-space: nowrap;
}

.facebook-mark {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
  border-radius: 4px;
  color: var(--white);
  background: #1877f2;
  font-family: Arial, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

button:disabled {
  opacity: 0.62;
  cursor: wait;
}

img {
  display: block;
  max-width: 100%;
}

.admin-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 32px 0;
}

.login-panel {
  width: min(460px, 100%);
  margin: clamp(36px, 10vh, 110px) auto 0;
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid var(--line);
  border-top: 5px solid var(--red);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.login-panel img {
  width: 210px;
  margin-bottom: 28px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.04;
}

h2 {
  font-size: 1.22rem;
  line-height: 1.15;
}

.login-form,
.product-form {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--black);
  font-size: 0.86rem;
  font-weight: 850;
  text-transform: uppercase;
}

.field-help {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.4;
  text-transform: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 13px 14px;
  color: var(--carbon);
  background: var(--white);
  font-size: 1rem;
  font-weight: 500;
  text-transform: none;
}

select {
  appearance: auto;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red);
  outline: 3px solid rgba(189, 3, 3, 0.14);
}

.check-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-line input {
  width: 20px;
  height: 20px;
}

.form-message {
  min-height: 24px;
  color: var(--red-dark);
  font-weight: 750;
}

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

.dashboard-header > div {
  display: flex;
  align-items: center;
  gap: 18px;
}

.dashboard-header img {
  width: clamp(140px, 18vw, 230px);
}

.dashboard-header nav,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.42fr) minmax(0, 1fr);
  gap: 22px;
}

.editor-panel,
.list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.08);
}

.editor-panel {
  align-self: start;
  position: sticky;
  top: 20px;
  padding: 24px;
}

.list-panel {
  overflow: hidden;
}

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

.list-head span {
  min-width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  color: var(--white);
  background: var(--red);
  font-weight: 900;
}

.list-filters {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(140px, 0.8fr) minmax(160px, 0.9fr) minmax(220px, 1.25fr);
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.list-filters label {
  gap: 6px;
  font-size: 0.74rem;
}

.list-filters input,
.list-filters select {
  min-height: 42px;
  padding: 10px 12px;
  background: var(--white);
  font-size: 0.95rem;
}

.product-list {
  display: grid;
}

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

.product-row:last-child {
  border-bottom: 0;
}

.product-row img {
  width: 132px;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
  background: var(--black);
}

.product-row-body {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 380px);
  gap: 18px;
  align-content: start;
  align-items: start;
}

.product-row-content {
  min-width: 0;
}

.product-row-controls {
  width: 100%;
  max-width: 380px;
  display: grid;
  gap: 12px;
  justify-items: start;
  justify-self: end;
}

.product-row h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.18;
}

.product-row p {
  margin-top: 8px;
  color: var(--muted);
}

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.product-meta {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin: 0;
  padding: 0 10px;
  border-radius: 4px;
  color: var(--white);
  background: var(--black);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.product-meta.status.is-active {
  background: var(--red);
}

.product-meta.status.is-hidden-status {
  background: var(--black);
}

.product-meta.category {
  background: var(--paper);
  color: var(--black);
  border: 1px solid var(--line);
}

.product-meta.logo-status {
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
}

.product-meta.logo-status.has-logo {
  color: var(--white);
  border-color: var(--black);
  background: var(--black);
}

.product-row .card-actions {
  display: grid;
  grid-template-columns: minmax(112px, auto) minmax(124px, auto) minmax(102px, auto);
  justify-content: start;
  gap: 10px;
  width: 100%;
}

.product-row .card-actions button,
.product-row .card-actions a {
  width: 100%;
  min-width: 0;
  padding: 0 16px;
}

.empty-state {
  padding: 28px 24px;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 1120px) {
  .product-row-body {
    grid-template-columns: 1fr;
  }

  .product-row-controls {
    max-width: none;
    justify-self: stretch;
  }
}

@media (max-width: 860px) {
  .dashboard-header,
  .dashboard-header > div,
  .dashboard-grid,
  .list-filters,
  .product-row {
    grid-template-columns: 1fr;
  }

  .dashboard-header,
  .dashboard-header > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .editor-panel {
    position: static;
  }

  .product-row img {
    width: 100%;
    max-height: 260px;
  }

  .product-row-body {
    grid-template-columns: 1fr;
  }

  .product-row .card-actions {
    grid-template-columns: 1fr;
  }
}
