.admin-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.admin-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  margin-bottom: 24px;
}

.admin-header__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-brand {
  width: 118px;
}

.admin-brand img {
  width: 100%;
  display: block;
}

.admin-header h1,
.admin-form h2,
.admin-products h2 {
  margin: 6px 0 0;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.admin-dashboard article,
.admin-form,
.admin-products,
.admin-product {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-dashboard article {
  padding: 20px;
}

.admin-dashboard span {
  color: var(--muted);
  font-weight: 800;
}

.admin-dashboard strong {
  display: block;
  margin-top: 8px;
  color: var(--brand);
  font-size: 34px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 18px;
  align-items: start;
}

.login-panel {
  max-width: 460px;
  margin: 60px auto 0;
}

.login-form {
  box-shadow: var(--shadow);
}

.login-form .primary-btn {
  width: 100%;
}

.form-message {
  min-height: 22px;
  margin: -4px 0 14px;
  color: #b42318;
  font-weight: 800;
}

.admin-form,
.admin-products {
  padding: 22px;
}

.form-heading,
.list-toolbar {
  margin-bottom: 18px;
}

.form-heading p,
.list-toolbar p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.admin-form label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #294064;
  font-weight: 800;
}

.photo-field { margin-bottom: 18px; }
.photo-field small { display: block; margin: 8px 0; color: var(--muted); font-size: 12px; }
.photo-preview { display: block; width: 100%; height: 180px; object-fit: contain; margin: 12px 0; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.photo-preview[hidden], #clearPhoto[hidden] { display: none; }
.photo-message { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; color: var(--muted); }
.photo-message:empty { display: none; }
.photo-message.error { color: #b42318; }
.admin-form input[type=file] { font-size: 13px; padding: 8px; }
.admin-form input[type=file]::file-selector-button { padding: 9px 12px; margin-right: 10px; border: 0; border-radius: 4px; background: var(--brand); color: #fff; cursor: pointer; }

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: var(--soft);
  outline: 0;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 107, 255, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions,
.list-toolbar,
.admin-product__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-actions {
  justify-content: flex-end;
}

.list-toolbar {
  justify-content: space-between;
}

.danger-btn {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: #ffe9e9;
  color: #b42318;
  font-weight: 900;
  cursor: pointer;
}

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

.admin-product {
  padding: 12px;
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 14px;
  align-items: center;
}

.admin-product img {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--soft);
}

.admin-product span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.admin-product h3 {
  margin: 5px 0;
  line-height: 1.2;
}

.admin-product p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.4;
}

.admin-product strong {
  color: var(--ink);
}

@media (max-width: 920px) {
  .admin-header,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-header__actions {
    justify-content: flex-start;
  }

  .admin-site-link {
    justify-self: start;
  }

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

  .admin-product {
    grid-template-columns: 80px 1fr;
  }

  .admin-product img {
    width: 80px;
    height: 80px;
  }

  .admin-product__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 560px) {
  .form-row,
  .list-toolbar {
    grid-template-columns: 1fr;
    display: grid;
  }

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

  .admin-product img {
    width: 100%;
    height: 170px;
  }

  .admin-product__actions,
  .form-actions {
    justify-content: stretch;
  }

  .admin-product__actions button,
  .form-actions button {
    flex: 1;
  }
}
